Commit 20da7b22 authored by Marko Mäkelä's avatar Marko Mäkelä

MDEV-24410: Bug in SRW_LOCK_DUMMY rw_lock_t wrapper

In commit 43d3dad1 we forgot to
invert the return values of rw_tryrdlock() and rw_trywrlock(),
causing strange failures.
parent 43d3dad1
......@@ -124,10 +124,10 @@ class srw_lock_low
void init() { my_rwlock_init(&lock, nullptr); }
void destroy() { rwlock_destroy(&lock); }
void rd_lock() { rw_rdlock(&lock); }
bool rd_lock_try() { return rw_tryrdlock(&lock); }
bool rd_lock_try() { return !rw_tryrdlock(&lock); }
void rd_unlock() { rw_unlock(&lock); }
void wr_lock() { rw_wrlock(&lock); }
bool wr_lock_try() { return rw_trywrlock(&lock); }
bool wr_lock_try() { return !rw_trywrlock(&lock); }
void wr_unlock() { rw_unlock(&lock); }
# endif
};
......
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