summaryrefslogtreecommitdiff
path: root/mysys
diff options
context:
space:
mode:
authorunknown <mronstrom@mysql.com>2005-07-19 00:29:19 +0200
committerunknown <mronstrom@mysql.com>2005-07-19 00:29:19 +0200
commit6d29b23b15cdb14e0f60804db4eaeb5718cec78a (patch)
tree8cac93afd968960ab2b0e70bf1d21eaefadecd79 /mysys
parent5c27ff06c739c405c3ef09357c4f7deeae40b4b1 (diff)
downloadmariadb-git-6d29b23b15cdb14e0f60804db4eaeb5718cec78a.tar.gz
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
Diffstat (limited to 'mysys')
-rw-r--r--mysys/thr_lock.c7
1 files changed, 5 insertions, 2 deletions
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);
}