InnoDB Plugin
1.0
|
Functions | |
UNIV_INTERN void | rw_lock_s_lock_spin (rw_lock_t *lock, ulint pass, const char *file_name, ulint line) |
UNIV_INTERN void | rw_lock_add_debug_info (rw_lock_t *lock, ulint pass, ulint lock_type, const char *file_name, ulint line) |
UNIV_INTERN void | rw_lock_remove_debug_info (rw_lock_t *lock, ulint pass, ulint lock_type) |
UNIV_INLINE ulint | rw_lock_get_waiters (const rw_lock_t *lock) |
UNIV_INLINE void | rw_lock_set_waiter_flag (rw_lock_t *lock) |
UNIV_INLINE void | rw_lock_reset_waiter_flag (rw_lock_t *lock) |
UNIV_INLINE ulint | rw_lock_get_writer (const rw_lock_t *lock) |
UNIV_INLINE ulint | rw_lock_get_reader_count (const rw_lock_t *lock) |
UNIV_INLINE ib_mutex_t * | rw_lock_get_mutex (rw_lock_t *lock) |
UNIV_INLINE ulint | rw_lock_get_x_lock_count (const rw_lock_t *lock) |
UNIV_INLINE ibool | rw_lock_lock_word_decr (rw_lock_t *lock, ulint amount) |
UNIV_INLINE lint | rw_lock_lock_word_incr (rw_lock_t *lock, ulint amount) |
UNIV_INLINE void | rw_lock_set_writer_id_and_recursion_flag (rw_lock_t *lock, ibool recursive) |
UNIV_INLINE ibool | rw_lock_s_lock_low (rw_lock_t *lock, ulint pass) |
UNIV_INLINE ibool const char ulint line | if (!rw_lock_lock_word_decr(lock, 1)) |
rw_lock_add_debug_info (lock, pass, RW_LOCK_SHARED, file_name, line) | |
return (TRUE) | |
UNIV_INLINE void | rw_lock_s_lock_func (rw_lock_t *lock, ulint pass, const char *file_name, ulint line) |
UNIV_INLINE ibool | rw_lock_x_lock_func_nowait (rw_lock_t *lock, const char *file_name, ulint line) |
UNIV_INLINE void | rw_lock_s_unlock_func (ulint pass, rw_lock_t *lock) |
UNIV_INLINE void | rw_lock_x_unlock_func (ulint pass, rw_lock_t *lock) |
Variables | |
UNIV_INLINE ibool const char * | file_name |
lock | last_s_file_name = file_name |
lock | last_s_line = line |
The read-write lock (for threads)
Created 9/11/1995 Heikki Tuuri
< in: line where requested
UNIV_INTERN void rw_lock_add_debug_info | ( | rw_lock_t * | lock, |
ulint | pass, | ||
ulint | lock_type, | ||
const char * | file_name, | ||
ulint | line | ||
) |
Inserts the debug information for an rw-lock. in: line where requested
lock | in: rw-lock |
pass | in: pass value |
lock_type | in: lock type |
file_name | in: file where requested |
UNIV_INLINE ulint rw_lock_get_reader_count | ( | const rw_lock_t * | lock | ) |
Returns the number of readers.
lock | in: rw-lock |
UNIV_INLINE ulint rw_lock_get_waiters | ( | const rw_lock_t * | lock | ) |
Check if there are threads waiting for the rw-lock.
lock | in: rw-lock |
UNIV_INLINE ulint rw_lock_get_writer | ( | const rw_lock_t * | lock | ) |
Returns the write-status of the lock - this function made more sense with the old rw_lock implementation.
lock | in: rw-lock |
UNIV_INLINE ulint rw_lock_get_x_lock_count | ( | const rw_lock_t * | lock | ) |
Returns the value of writer_count for the lock. Does not reserve the lock mutex, so the caller must be sure it is not changed during the call.
lock | in: rw-lock |
Two different implementations for decrementing the lock_word of a rw_lock: one for systems supporting atomic operations, one for others. This does does not support recusive x-locks: they should be handled by the caller and need not be atomic since they are performed by the current lock holder. Returns true if the decrement was made, false if not.
lock | in/out: rw-lock |
amount | in: amount to decrement |
UNIV_INLINE lint rw_lock_lock_word_incr | ( | rw_lock_t * | lock, |
ulint | amount | ||
) |
Increments lock_word the specified amount and returns new value.
lock | in/out: rw-lock |
amount | in: amount of increment |
UNIV_INTERN void rw_lock_remove_debug_info | ( | rw_lock_t * | lock, |
ulint | pass, | ||
ulint | lock_type | ||
) |
Removes a debug information struct for an rw-lock. in: lock type
lock | in: rw-lock |
pass | in: pass value |
UNIV_INLINE void rw_lock_reset_waiter_flag | ( | rw_lock_t * | lock | ) |
Resets lock->waiters to 0. It is not an error if lock->waiters is already 0. On platforms where ATOMIC builtins are used this function enforces a memory barrier.
lock | in/out: rw-lock |
UNIV_INLINE void rw_lock_s_lock_func | ( | rw_lock_t * | lock, |
ulint | pass, | ||
const char * | file_name, | ||
ulint | line | ||
) |
NOTE! Use the corresponding macro, not directly this function! Lock an rw-lock in shared mode for the current thread. If the rw-lock is locked in exclusive mode, or there is an exclusive lock request waiting, the function spins a preset time (controlled by SYNC_SPIN_ROUNDS), waiting for the lock, before suspending the thread.
lock | in: pointer to rw-lock |
pass | in: pass value; != 0, if the lock will be passed to another thread to unlock |
file_name | in: file name where lock requested |
line | in: line where requested |
Low-level function which tries to lock an rw-lock in s-mode. Performs no spinning.
lock | in: pointer to rw-lock |
UNIV_INTERN void rw_lock_s_lock_spin | ( | rw_lock_t * | lock, |
ulint | pass, | ||
const char * | file_name, | ||
ulint | line | ||
) |
Lock an rw-lock in shared mode for the current thread. If the rw-lock is locked in exclusive mode, or there is an exclusive lock request waiting, the function spins a preset time (controlled by SYNC_SPIN_ROUNDS), waiting for the lock before suspending the thread. in: line where requested
lock | in: pointer to rw-lock |
pass | in: pass value; != 0, if the lock will be passed to another thread to unlock |
file_name | in: file name where lock requested |
UNIV_INLINE void rw_lock_s_unlock_func | ( | ulint | pass, |
rw_lock_t * | lock | ||
) |
Releases a shared mode lock.
pass | in: pass value; != 0, if the lock may have been passed to another thread to unlock |
lock | in/out: rw-lock |
UNIV_INLINE void rw_lock_set_waiter_flag | ( | rw_lock_t * | lock | ) |
Sets lock->waiters to 1. It is not an error if lock->waiters is already
lock | in/out: rw-lock |
This function sets the lock->writer_thread and lock->recursive fields. For platforms where we are using atomic builtins instead of lock->mutex it sets the lock->writer_thread field using atomics to ensure memory ordering. Note that it is assumed that the caller of this function effectively owns the lock i.e.: nobody else is allowed to modify lock->writer_thread at this point in time. The protocol is that lock->writer_thread MUST be updated BEFORE the lock->recursive flag is set.
lock | in/out: lock to work on |
recursive | in: TRUE if recursion allowed |
UNIV_INLINE ibool rw_lock_x_lock_func_nowait | ( | rw_lock_t * | lock, |
const char * | file_name, | ||
ulint | line | ||
) |
NOTE! Use the corresponding macro, not directly this function! Lock an rw-lock in exclusive mode for the current thread if the lock can be obtained immediately.
lock | in: pointer to rw-lock |
file_name | in: file name where lock requested |
line | in: line where requested |
UNIV_INLINE void rw_lock_x_unlock_func | ( | ulint | pass, |
rw_lock_t * | lock | ||
) |
Releases an exclusive mode lock.
pass | in: pass value; != 0, if the lock may have been passed to another thread to unlock |
lock | in/out: rw-lock |
UNIV_INLINE ibool const char* file_name |
< in: pass value; != 0, if the lock will be passed to another thread to unlock in: file name where lock requested