Skip to content

Commit

Permalink
MDEV-24410: Bug in SRW_LOCK_DUMMY rw_lock_t wrapper
Browse files Browse the repository at this point in the history
In commit 43d3dad we forgot to
invert the return values of rw_tryrdlock() and rw_trywrlock(),
causing strange failures.
  • Loading branch information
dr-m committed Dec 15, 2020
1 parent 43d3dad commit 20da7b2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions storage/innobase/include/srw_lock.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
};
Expand Down

0 comments on commit 20da7b2

Please sign in to comment.