diff options
author | Sergei Golubchik <serg@mysql.com> | 2008-10-21 16:10:04 +0200 |
---|---|---|
committer | Sergei Golubchik <serg@mysql.com> | 2008-10-21 16:10:04 +0200 |
commit | c6a51b044739d6c1b0406ba7561334b1c373a022 (patch) | |
tree | b11c4eadb398730ab0cee5bf0eb69ecd7168a0c7 /mysys/thr_rwlock.c | |
parent | ade71b252276f8cd3de2b325074ef1dfb5694daf (diff) | |
download | mariadb-git-c6a51b044739d6c1b0406ba7561334b1c373a022.tar.gz |
fixes for hanging waiting_thread-t.c on windows
mysys/my_wincond.c:
race condition: block gate could be left open forever, if cond_broadcast
was done right after the last thread left WaitForMultipleObjects() on timeout
mysys/thr_rwlock.c:
make rwlocks behave similar to their distant linux/solaris relatives
Diffstat (limited to 'mysys/thr_rwlock.c')
-rw-r--r-- | mysys/thr_rwlock.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/mysys/thr_rwlock.c b/mysys/thr_rwlock.c index 0aa4d3fc3c4..2a249cbf850 100644 --- a/mysys/thr_rwlock.c +++ b/mysys/thr_rwlock.c @@ -89,7 +89,7 @@ int my_rw_rdlock(rw_lock_t *rwp) pthread_mutex_lock(&rwp->lock); /* active or queued writers */ - while (( rwp->state < 0 ) || rwp->waiters) + while (( rwp->state < 0 )) pthread_cond_wait( &rwp->readers, &rwp->lock); rwp->state++; @@ -101,7 +101,7 @@ int my_rw_tryrdlock(rw_lock_t *rwp) { int res; pthread_mutex_lock(&rwp->lock); - if ((rwp->state < 0 ) || rwp->waiters) + if ((rwp->state < 0 )) res= EBUSY; /* Can't get lock */ else { |