summaryrefslogtreecommitdiff
path: root/sql/lock.cc
diff options
context:
space:
mode:
authorunknown <guilhem@mysql.com>2005-02-23 17:38:51 +0100
committerunknown <guilhem@mysql.com>2005-02-23 17:38:51 +0100
commit5941f19bbdf1d321dcdab5adff857be486387d30 (patch)
treeee4341e2c130045f07ecec38b6f387dd5081ce88 /sql/lock.cc
parent2ae6eb094bb02a3e41ab611c9e9f27982a2ef9c3 (diff)
downloadmariadb-git-5941f19bbdf1d321dcdab5adff857be486387d30.tar.gz
FIx for BUG#8682 "flush_block_commit test hangs on HPUX":
start_waiting_global_read_lock() should wake up all those who are waiting for protect_against_global_read_lock to go down to 0: those registered in waiting_for_read_lock AND those registered in global_read_lock_blocks_commit. sql/lock.cc: start_waiting_global_read_lock() should wake up all those who are waiting for protect_against_global_read_lock to go down to 0: those registered in waiting_for_read_lock AND those registered in global_read_lock_blocks_commit.
Diffstat (limited to 'sql/lock.cc')
-rw-r--r--sql/lock.cc5
1 files changed, 3 insertions, 2 deletions
diff --git a/sql/lock.cc b/sql/lock.cc
index 7cfa2aebe7b..8f1cd080db7 100644
--- a/sql/lock.cc
+++ b/sql/lock.cc
@@ -715,7 +715,7 @@ static void print_lock_error(int error)
least the first step above)
global_read_lock_blocks_commit
count of threads which have the global read lock and block
- commits (i.e. have completed the second step above)
+ commits (i.e. are in or have completed the second step above)
waiting_for_read_lock
count of threads which want to take a global read lock but cannot
protect_against_global_read_lock
@@ -886,7 +886,8 @@ void start_waiting_global_read_lock(THD *thd)
if (unlikely(thd->global_read_lock))
DBUG_VOID_RETURN;
(void) pthread_mutex_lock(&LOCK_open);
- tmp= (!--protect_against_global_read_lock && waiting_for_read_lock);
+ tmp= (!--protect_against_global_read_lock &&
+ (waiting_for_read_lock || global_read_lock_blocks_commit));
(void) pthread_mutex_unlock(&LOCK_open);
if (tmp)
pthread_cond_broadcast(&COND_refresh);