From 6d29b23b15cdb14e0f60804db4eaeb5718cec78a Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 19 Jul 2005 00:29:19 +0200 Subject: Bug #10600 remove_table_from_cache fails to signal other thread and gets blocked when other thread also gets blocked include/thr_lock.h: Report if any threads was signalled mysys/thr_lock.c: Report if any threads was signalled sql/lock.cc: Report if any threads was signalled Use new interface for remove_table_from_cache sql/mysql_priv.h: New interface for remove_table_from_cache + mysql_lock_abort_for_thread sql/sql_base.cc: Use new interface of remove_table_cache Rewrote remove_table_from_cache to fix bug sql/sql_table.cc: Use new interface of remove_table_from_cache --- mysys/thr_lock.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'mysys/thr_lock.c') diff --git a/mysys/thr_lock.c b/mysys/thr_lock.c index 935ed4ea282..63dbe67c68e 100644 --- a/mysys/thr_lock.c +++ b/mysys/thr_lock.c @@ -966,9 +966,10 @@ void thr_abort_locks(THR_LOCK *lock) This is used to abort all locks for a specific thread */ -void thr_abort_locks_for_thread(THR_LOCK *lock, pthread_t thread) +bool thr_abort_locks_for_thread(THR_LOCK *lock, pthread_t thread) { THR_LOCK_DATA *data; + bool found= FALSE; DBUG_ENTER("thr_abort_locks_for_thread"); pthread_mutex_lock(&lock->mutex); @@ -978,6 +979,7 @@ void thr_abort_locks_for_thread(THR_LOCK *lock, pthread_t thread) { DBUG_PRINT("info",("Aborting read-wait lock")); data->type= TL_UNLOCK; /* Mark killed */ + found= TRUE; pthread_cond_signal(data->cond); data->cond= 0; /* Removed from list */ @@ -993,6 +995,7 @@ void thr_abort_locks_for_thread(THR_LOCK *lock, pthread_t thread) { DBUG_PRINT("info",("Aborting write-wait lock")); data->type= TL_UNLOCK; + found= TRUE; pthread_cond_signal(data->cond); data->cond= 0; @@ -1003,7 +1006,7 @@ void thr_abort_locks_for_thread(THR_LOCK *lock, pthread_t thread) } } pthread_mutex_unlock(&lock->mutex); - DBUG_VOID_RETURN; + DBUG_RETURN(found); } -- cgit v1.2.1