diff options
author | unknown <serg@serg.mylan> | 2005-03-17 08:46:48 +0100 |
---|---|---|
committer | unknown <serg@serg.mylan> | 2005-03-17 08:46:48 +0100 |
commit | 8d55ca327b74ce03492447be6af76eb5eef61f29 (patch) | |
tree | 37a5d35e424f7ed118f092a6b045f239969554e3 /sql/lock.cc | |
parent | 5de05a3a3a1a934548b36672bb4227068d00ee27 (diff) | |
parent | 8e649cef2f2c51a1924461e1d37e2079c953c72a (diff) | |
download | mariadb-git-8d55ca327b74ce03492447be6af76eb5eef61f29.tar.gz |
Merge bk-internal:/home/bk/mysql-5.0
into serg.mylan:/usr/home/serg/Abk/mysql-5.0
sql/handler.cc:
Auto merged
sql/lock.cc:
Auto merged
sql/mysql_priv.h:
Auto merged
sql/mysqld.cc:
Auto merged
sql/sql_parse.cc:
Auto merged
sql/sql_table.cc:
Auto merged
Diffstat (limited to 'sql/lock.cc')
-rw-r--r-- | sql/lock.cc | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/sql/lock.cc b/sql/lock.cc index 507e802d2e8..266e8dc4d4d 100644 --- a/sql/lock.cc +++ b/sql/lock.cc @@ -800,8 +800,8 @@ bool lock_global_read_lock(THD *thd) if (!thd->global_read_lock) { - (void) pthread_mutex_lock(&LOCK_open); - const char *old_message=thd->enter_cond(&COND_refresh, &LOCK_open, + (void) pthread_mutex_lock(&LOCK_global_read_lock); + const char *old_message=thd->enter_cond(&COND_refresh, &LOCK_global_read_lock, "Waiting to get readlock"); DBUG_PRINT("info", ("waiting_for: %d protect_against: %d", @@ -809,7 +809,7 @@ bool lock_global_read_lock(THD *thd) waiting_for_read_lock++; while (protect_against_global_read_lock && !thd->killed) - pthread_cond_wait(&COND_refresh, &LOCK_open); + pthread_cond_wait(&COND_refresh, &LOCK_global_read_lock); waiting_for_read_lock--; if (thd->killed) { @@ -834,11 +834,11 @@ bool lock_global_read_lock(THD *thd) void unlock_global_read_lock(THD *thd) { uint tmp; - pthread_mutex_lock(&LOCK_open); + pthread_mutex_lock(&LOCK_global_read_lock); tmp= --global_read_lock; if (thd->global_read_lock == MADE_GLOBAL_READ_LOCK_BLOCK_COMMIT) --global_read_lock_blocks_commit; - pthread_mutex_unlock(&LOCK_open); + pthread_mutex_unlock(&LOCK_global_read_lock); /* Send the signal outside the mutex to avoid a context switch */ if (!tmp) pthread_cond_broadcast(&COND_refresh); @@ -857,7 +857,7 @@ bool wait_if_global_read_lock(THD *thd, bool abort_on_refresh, DBUG_ENTER("wait_if_global_read_lock"); LINT_INIT(old_message); - (void) pthread_mutex_lock(&LOCK_open); + (void) pthread_mutex_lock(&LOCK_global_read_lock); if ((need_exit_cond= must_wait)) { if (thd->global_read_lock) // This thread had the read locks @@ -865,7 +865,7 @@ bool wait_if_global_read_lock(THD *thd, bool abort_on_refresh, if (is_not_commit) my_message(ER_CANT_UPDATE_WITH_READLOCK, ER(ER_CANT_UPDATE_WITH_READLOCK), MYF(0)); - (void) pthread_mutex_unlock(&LOCK_open); + (void) pthread_mutex_unlock(&LOCK_global_read_lock); /* We allow FLUSHer to COMMIT; we assume FLUSHer knows what it does. This allowance is needed to not break existing versions of innobackup @@ -873,11 +873,11 @@ bool wait_if_global_read_lock(THD *thd, bool abort_on_refresh, */ DBUG_RETURN(is_not_commit); } - old_message=thd->enter_cond(&COND_refresh, &LOCK_open, + old_message=thd->enter_cond(&COND_refresh, &LOCK_global_read_lock, "Waiting for release of readlock"); while (must_wait && ! thd->killed && (!abort_on_refresh || thd->version == refresh_version)) - (void) pthread_cond_wait(&COND_refresh,&LOCK_open); + (void) pthread_cond_wait(&COND_refresh,&LOCK_global_read_lock); if (thd->killed) result=1; } @@ -890,7 +890,7 @@ bool wait_if_global_read_lock(THD *thd, bool abort_on_refresh, if (unlikely(need_exit_cond)) thd->exit_cond(old_message); else - pthread_mutex_unlock(&LOCK_open); + pthread_mutex_unlock(&LOCK_global_read_lock); DBUG_RETURN(result); } @@ -901,10 +901,10 @@ void start_waiting_global_read_lock(THD *thd) DBUG_ENTER("start_waiting_global_read_lock"); if (unlikely(thd->global_read_lock)) DBUG_VOID_RETURN; - (void) pthread_mutex_lock(&LOCK_open); + (void) pthread_mutex_lock(&LOCK_global_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_global_read_lock); if (tmp) pthread_cond_broadcast(&COND_refresh); DBUG_VOID_RETURN; @@ -922,16 +922,16 @@ bool make_global_read_lock_block_commit(THD *thd) */ if (thd->global_read_lock != GOT_GLOBAL_READ_LOCK) DBUG_RETURN(1); - pthread_mutex_lock(&LOCK_open); + pthread_mutex_lock(&LOCK_global_read_lock); /* increment this BEFORE waiting on cond (otherwise race cond) */ global_read_lock_blocks_commit++; /* For testing we set up some blocking, to see if we can be killed */ DBUG_EXECUTE_IF("make_global_read_lock_block_commit_loop", protect_against_global_read_lock++;); - old_message= thd->enter_cond(&COND_refresh, &LOCK_open, + old_message= thd->enter_cond(&COND_refresh, &LOCK_global_read_lock, "Waiting for all running commits to finish"); while (protect_against_global_read_lock && !thd->killed) - pthread_cond_wait(&COND_refresh, &LOCK_open); + pthread_cond_wait(&COND_refresh, &LOCK_global_read_lock); DBUG_EXECUTE_IF("make_global_read_lock_block_commit_loop", protect_against_global_read_lock--;); if (error= thd->killed) |