diff options
author | monty@work.mysql.com <> | 2001-09-02 18:38:33 +0200 |
---|---|---|
committer | monty@work.mysql.com <> | 2001-09-02 18:38:33 +0200 |
commit | 447c18954e904e5770d64ae3b0817a16b9060b74 (patch) | |
tree | 4689ffbe50e97ce9a47deb58fa2b9e7decdfc6a8 /sql/sql_base.cc | |
parent | 102cabfe4acd9c78fe321829bd168342b3fbd68a (diff) | |
parent | 759cf54a9e70013d92fe18a84b3e4c56244de7da (diff) | |
download | mariadb-git-447c18954e904e5770d64ae3b0817a16b9060b74.tar.gz |
merge with 3.23.42
Diffstat (limited to 'sql/sql_base.cc')
-rw-r--r-- | sql/sql_base.cc | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/sql/sql_base.cc b/sql/sql_base.cc index 2a9043cc0d7..57679b510e3 100644 --- a/sql/sql_base.cc +++ b/sql/sql_base.cc @@ -352,11 +352,9 @@ bool close_cached_tables(THD *thd, bool if_wait_for_refresh, */ if (!tables) kill_delayed_threads(); - pthread_mutex_lock(&thd->mysys_var->mutex); thd->mysys_var->current_mutex= &LOCK_open; thd->mysys_var->current_cond= &COND_refresh; thd->proc_info="Flushing tables"; - pthread_mutex_unlock(&thd->mysys_var->mutex); close_old_data_files(thd,thd->open_tables,1,1); bool found=1; @@ -672,13 +670,12 @@ void wait_for_refresh(THD *thd) { /* Wait until the current table is up to date */ const char *proc_info; - pthread_mutex_lock(&thd->mysys_var->mutex); thd->mysys_var->current_mutex= &LOCK_open; thd->mysys_var->current_cond= &COND_refresh; proc_info=thd->proc_info; thd->proc_info="Waiting for table"; - pthread_mutex_unlock(&thd->mysys_var->mutex); - (void) pthread_cond_wait(&COND_refresh,&LOCK_open); + if (!thd->killed) + (void) pthread_cond_wait(&COND_refresh,&LOCK_open); pthread_mutex_unlock(&LOCK_open); // Must be unlocked first pthread_mutex_lock(&thd->mysys_var->mutex); @@ -1387,7 +1384,7 @@ TABLE *open_ltable(THD *thd, TABLE_LIST *table_list, thr_lock_type lock_type) { int error; -#ifdef __WIN__ +#if defined( __WIN__) || defined(OS2) /* Win32 can't drop a file that is open */ if (lock_type == TL_WRITE_ALLOW_READ #ifdef HAVE_GEMINI_DB @@ -1397,7 +1394,7 @@ TABLE *open_ltable(THD *thd, TABLE_LIST *table_list, thr_lock_type lock_type) { lock_type= TL_WRITE; } -#endif /* __WIN__ */ +#endif /* __WIN__ || OS2 */ table_list->table=table; table->grant= table_list->grant; @@ -2169,7 +2166,7 @@ bool remove_table_from_cache(THD *thd, const char *db, const char *table_name, { in_use->killed=1; pthread_mutex_lock(&in_use->mysys_var->mutex); - if (in_use->mysys_var->current_mutex) + if (in_use->mysys_var->current_cond) { pthread_mutex_lock(in_use->mysys_var->current_mutex); pthread_cond_broadcast(in_use->mysys_var->current_cond); |