From 733f865f54e297bf512f10ec0631342303164b25 Mon Sep 17 00:00:00 2001 From: "monty@hundin.mysql.fi" <> Date: Wed, 22 Aug 2001 01:45:07 +0300 Subject: Fixes for OS2. Fix bug in isamlog Add argument types to function declarations. --- sql/sql_base.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'sql/sql_base.cc') diff --git a/sql/sql_base.cc b/sql/sql_base.cc index a38829f3605..d885d308770 100644 --- a/sql/sql_base.cc +++ b/sql/sql_base.cc @@ -1401,7 +1401,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 @@ -1411,7 +1411,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; -- cgit v1.2.1 From 7f4aee1c907d3e8d26de50df698b5677bbdd759d Mon Sep 17 00:00:00 2001 From: "monty@hundin.mysql.fi" <> Date: Sat, 1 Sep 2001 10:38:16 +0300 Subject: Make killing of threads safer --- sql/sql_base.cc | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'sql/sql_base.cc') diff --git a/sql/sql_base.cc b/sql/sql_base.cc index d885d308770..16495ab03b0 100644 --- a/sql/sql_base.cc +++ b/sql/sql_base.cc @@ -358,11 +358,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; @@ -667,13 +665,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); @@ -2182,7 +2179,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); -- cgit v1.2.1