summaryrefslogtreecommitdiff
path: root/sql/lock.cc
diff options
context:
space:
mode:
authorKonstantin Osipov <kostja@sun.com>2010-08-12 17:50:23 +0400
committerKonstantin Osipov <kostja@sun.com>2010-08-12 17:50:23 +0400
commit8673d2b20fe3cb1353f7b9b157e72dbf45382a48 (patch)
tree9e8417877eab9778cb09f99e71c11401e7749bbc /sql/lock.cc
parent65d118b1a4cb3cb4d75226b9280ee80b0d644f70 (diff)
parent5fff906edd3d7a5d999cec5403f009f33f8dfb81 (diff)
downloadmariadb-git-8673d2b20fe3cb1353f7b9b157e72dbf45382a48.tar.gz
Commit on behalf of Dmitry Lenev.
Merge his patch for Bug#52044 into 5.5, and apply review comments.
Diffstat (limited to 'sql/lock.cc')
-rw-r--r--sql/lock.cc26
1 files changed, 9 insertions, 17 deletions
diff --git a/sql/lock.cc b/sql/lock.cc
index 1a77b576e67..0181a544824 100644
--- a/sql/lock.cc
+++ b/sql/lock.cc
@@ -1298,27 +1298,19 @@ bool Global_read_lock::make_global_read_lock_block_commit(THD *thd)
/**
- Broadcast COND_refresh and COND_global_read_lock.
-
- Due to a bug in a threading library it could happen that a signal
- did not reach its target. A condition for this was that the same
- condition variable was used with different mutexes in
- mysql_cond_wait(). Some time ago we changed LOCK_open to
- LOCK_global_read_lock in global read lock handling. So COND_refresh
- was used with LOCK_open and LOCK_global_read_lock.
-
- We did now also change from COND_refresh to COND_global_read_lock
- in global read lock handling. But now it is necessary to signal
- both conditions at the same time.
-
- @note
- When signalling COND_global_read_lock within the global read lock
- handling, it is not necessary to also signal COND_refresh.
+ Broadcast COND_global_read_lock.
+
+ TODO/FIXME: Dmitry thinks that we broadcast on COND_global_read_lock
+ when old instance of table is closed to avoid races
+ between incrementing refresh_version and
+ wait_if_global_read_lock(thd, TRUE, FALSE) call.
+ Once global read lock implementation starts using MDL
+ infrastructure this will became unnecessary and should
+ be removed.
*/
void broadcast_refresh(void)
{
- mysql_cond_broadcast(&COND_refresh);
mysql_cond_broadcast(&COND_global_read_lock);
}