Commit 086c2a91 authored by guilhem@mysql.com's avatar guilhem@mysql.com

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.
parent 5e6ba9de
...@@ -715,7 +715,7 @@ static void print_lock_error(int error) ...@@ -715,7 +715,7 @@ static void print_lock_error(int error)
least the first step above) least the first step above)
global_read_lock_blocks_commit global_read_lock_blocks_commit
count of threads which have the global read lock and block 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 waiting_for_read_lock
count of threads which want to take a global read lock but cannot count of threads which want to take a global read lock but cannot
protect_against_global_read_lock protect_against_global_read_lock
...@@ -886,7 +886,8 @@ void start_waiting_global_read_lock(THD *thd) ...@@ -886,7 +886,8 @@ void start_waiting_global_read_lock(THD *thd)
if (unlikely(thd->global_read_lock)) if (unlikely(thd->global_read_lock))
DBUG_VOID_RETURN; DBUG_VOID_RETURN;
(void) pthread_mutex_lock(&LOCK_open); (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); (void) pthread_mutex_unlock(&LOCK_open);
if (tmp) if (tmp)
pthread_cond_broadcast(&COND_refresh); pthread_cond_broadcast(&COND_refresh);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment