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
commit29c4873ad5bb0e0f3eb1faf3f22ec00f11ca5cb4 (patch)
tree9e8417877eab9778cb09f99e71c11401e7749bbc /sql/lock.cc
parent265a6edd23cfdb69c6ac072bf01887f7aed1168c (diff)
parent00496b7acd1f2ac8b099ba7e6a4c7bbf09178384 (diff)
downloadmariadb-git-29c4873ad5bb0e0f3eb1faf3f22ec00f11ca5cb4.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);
}