Commit 3e5c7d0c authored by Vadim Tkachenko's avatar Vadim Tkachenko

sync with rev43

parent 4ba507ef
......@@ -2544,6 +2544,8 @@ i_s_innodb_rseg_fill(
int status = 0;
trx_rseg_t* rseg;
DBUG_ENTER("i_s_innodb_rseg_fill");
/* deny access to non-superusers */
if (check_global_access(thd, PROCESS_ACL)) {
......
......@@ -352,6 +352,13 @@ rw_lock_s_lock_spin(
return; /* Success */
}
}
/* If wait_ex_waiter stalls, wakes it. */
if (lock->wait_ex_waiters && lock->lock_word == RW_LOCK_BIAS) {
rw_lock_set_wx_waiters(lock, 0);
os_event_set(lock->wait_ex_event);
sync_array_object_signalled(sync_primary_wait_array);
}
#else
mutex_exit(rw_lock_get_mutex(lock));
#endif
......@@ -447,7 +454,7 @@ rw_lock_x_lock_low(
switch(rw_lock_get_writer(lock)) {
case RW_LOCK_WAIT_EX:
/* have right to try x-lock */
if (lock->lock_word == RW_LOCK_BIAS) {
retry_x_lock:
/* try x-lock */
if(__sync_sub_and_fetch(&(lock->lock_word),
RW_LOCK_BIAS) == 0) {
......@@ -467,12 +474,12 @@ rw_lock_x_lock_low(
/* Locking succeeded, we may return */
return(RW_LOCK_EX);
} else {
/* fail */
__sync_fetch_and_add(&(lock->lock_word),
RW_LOCK_BIAS);
}
} else if(__sync_fetch_and_add(&(lock->lock_word),
RW_LOCK_BIAS) == 0) {
/* retry x-lock */
goto retry_x_lock;
}
/* There are readers, we have to wait */
return(RW_LOCK_WAIT_EX);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment