|
drizzle
C++ MySQL-protocol-compatible database server
|
#include <sync0rw.h>
Public Member Functions | |
| UT_LIST_NODE_T (rw_lock_t) list | |
Public Attributes | |
| volatile lint | lock_word |
| volatile ulint | waiters |
| volatile ibool | recursive |
| volatile os_thread_id_t | writer_thread |
| os_event_t | event |
| os_event_t | wait_ex_event |
| mutex_t | mutex |
| ulint | count_os_wait |
| const char * | cfile_name |
| const char * | last_s_file_name |
| const char * | last_x_file_name |
| ibool | writer_is_wait_ex |
| unsigned | cline:14 |
| unsigned | last_s_line:14 |
| unsigned | last_x_line:14 |
The structure used in the spin lock implementation of a read-write lock. Several threads may have a shared lock simultaneously in this lock, but only one writer may have an exclusive lock, in which case no shared locks are allowed. To prevent starving of a writer blocked by readers, a writer may queue for x-lock by decrementing lock_word: no new readers will be let in while the thread waits for readers to exit.
| rw_lock_struct::UT_LIST_NODE_T | ( | rw_lock_t | ) |
All allocated rw locks are put into a list
| const char* rw_lock_struct::cfile_name |
| ulint rw_lock_struct::count_os_wait |
| os_event_t rw_lock_struct::event |
| const char* rw_lock_struct::last_s_file_name |
| unsigned rw_lock_struct::last_s_line |
| const char* rw_lock_struct::last_x_file_name |
| unsigned rw_lock_struct::last_x_line |
| volatile lint rw_lock_struct::lock_word |
| mutex_t rw_lock_struct::mutex |
The mutex protecting rw_lock_struct
| volatile ibool rw_lock_struct::recursive |
Default value FALSE which means the lock is non-recursive. The value is typically set to TRUE making normal rw_locks recursive. In case of asynchronous IO, when a non-zero value of 'pass' is passed then we keep the lock non-recursive. This flag also tells us about the state of writer_thread field. If this flag is set then writer_thread MUST contain the thread id of the current x-holder or wait-x thread. This flag must be reset in x_unlock functions before incrementing the lock_word
| os_event_t rw_lock_struct::wait_ex_event |
| volatile ulint rw_lock_struct::waiters |
| ibool rw_lock_struct::writer_is_wait_ex |
| volatile os_thread_id_t rw_lock_struct::writer_thread |