diff options
author | ingo@mysql.com <> | 2006-06-26 19:14:35 +0200 |
---|---|---|
committer | ingo@mysql.com <> | 2006-06-26 19:14:35 +0200 |
commit | d27a15a81c8806ff6d41ccd0303909f0c5a9f174 (patch) | |
tree | f72941273e5da9bb2f5853ff33357f7b0c0a118c /mysys/thr_lock.c | |
parent | fa98891ee74531b05d0e9f7c5e3a2cce9a751288 (diff) | |
download | mariadb-git-d27a15a81c8806ff6d41ccd0303909f0c5a9f174.tar.gz |
Bug#16986 - Deadlock condition with MyISAM tables
Addendum fixes after changing the condition variable
for the global read lock.
The stress test suite revealed some deadlocks. Some were
related to the new condition variable (COND_global_read_lock)
and some were general problems with the global read lock.
It is now necessary to signal COND_global_read_lock whenever
COND_refresh is signalled.
We need to wait for the release of a global read lock if one
is set before every operation that requires a write lock.
But we must not wait if we have locked tables by LOCK TABLES.
After setting a global read lock a thread waits until all
write locks are released.
Diffstat (limited to 'mysys/thr_lock.c')
-rw-r--r-- | mysys/thr_lock.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/mysys/thr_lock.c b/mysys/thr_lock.c index f5a8b618949..51df50a4926 100644 --- a/mysys/thr_lock.c +++ b/mysys/thr_lock.c @@ -204,6 +204,8 @@ static void check_locks(THR_LOCK *lock, const char *where, { if ((int) data->type == (int) TL_READ_NO_INSERT) count++; + /* Protect against infinite loop. */ + DBUG_ASSERT(count <= lock->read_no_write_count); } if (count != lock->read_no_write_count) { |