MySQL 5.6.14 Source Code Document
|
#include <rpl_gtid.h>
Public Member Functions | |
Checkable_rwlock () | |
Initialize this Checkable_rwlock. | |
~Checkable_rwlock () | |
Destroy this Checkable_lock. | |
void | rdlock () |
Acquire the read lock. | |
void | wrlock () |
Acquire the write lock. | |
void | unlock () |
Release the lock (whether it is a write or read lock). | |
bool | is_wrlock () |
void | assert_some_lock () const |
Assert that some thread holds either the read or the write lock. | |
void | assert_some_rdlock () const |
Assert that some thread holds the read lock. | |
void | assert_some_wrlock () const |
Assert that some thread holds the write lock. | |
void | assert_no_wrlock () const |
Assert that no thread holds the write lock. | |
void | assert_no_rdlock () const |
Assert that no thread holds the read lock. | |
void | assert_no_lock () const |
Assert that no thread holds read or write lock. |
This has the functionality of mysql_rwlock_t, with two differences:
Note that the assertions do not check whether this thread has taken the lock (that would be more complicated as it would require a dynamic data structure). Luckily, it is still likely that the assertions find bugs where a thread forgot to take a lock, because most of the time most locks are only used by one thread at a time.
The assertions are no-ops when DBUG is off.
Definition at line 317 of file rpl_gtid.h.
|
inline |
Return true if the write lock is held. Must only be called by threads that hold a lock.
Definition at line 391 of file rpl_gtid.h.