InnoDB Plugin
1.0
|
Functions | |
UNIV_INTERN void | mutex_set_waiters (ib_mutex_t *mutex, ulint n) |
UNIV_INTERN void | mutex_spin_wait (ib_mutex_t *mutex, const char *file_name, ulint line) |
UNIV_INTERN void | mutex_set_debug_info (ib_mutex_t *mutex, const char *file_name, ulint line) |
UNIV_INTERN void | mutex_signal_object (ib_mutex_t *mutex) |
UNIV_INLINE byte | ib_mutex_test_and_set (ib_mutex_t *mutex) |
UNIV_INLINE void | mutex_reset_lock_word (ib_mutex_t *mutex) |
UNIV_INLINE lock_word_t | mutex_get_lock_word (const ib_mutex_t *mutex) |
UNIV_INLINE ulint | mutex_get_waiters (const ib_mutex_t *mutex) |
UNIV_INLINE void | mutex_exit_func (ib_mutex_t *mutex) |
UNIV_INLINE void | mutex_enter_func (ib_mutex_t *mutex, const char *file_name, ulint line) |
UNIV_INLINE void | os_atomic_dec_ulint_func (ib_mutex_t *mutex, volatile ulint *var, ulint delta) |
UNIV_INLINE void | os_atomic_inc_ulint_func (ib_mutex_t *mutex, volatile ulint *var, ulint delta) |
Mutex, the basic synchronization primitive
Created 9/5/1995 Heikki Tuuri
UNIV_INLINE byte ib_mutex_test_and_set | ( | ib_mutex_t * | mutex | ) |
Performs an atomic test-and-set instruction to the lock_word field of a mutex.
mutex | in: mutex |
UNIV_INLINE void mutex_enter_func | ( | ib_mutex_t * | mutex, |
const char * | file_name, | ||
ulint | line | ||
) |
Locks a mutex for the current thread. If the mutex is reserved, the function spins a preset time (controlled by SYNC_SPIN_ROUNDS), waiting for the mutex before suspending the thread.
mutex | in: pointer to mutex |
file_name | in: file name where locked |
line | in: line where locked |
UNIV_INLINE void mutex_exit_func | ( | ib_mutex_t * | mutex | ) |
NOTE! Use the corresponding macro mutex_exit(), not directly this function! Unlocks a mutex owned by the current thread.
mutex | in: pointer to mutex |
UNIV_INLINE lock_word_t mutex_get_lock_word | ( | const ib_mutex_t * | mutex | ) |
Gets the value of the lock word.
mutex | in: mutex |
UNIV_INLINE ulint mutex_get_waiters | ( | const ib_mutex_t * | mutex | ) |
Gets the waiters field in a mutex.
< declared volatile to ensure that the value is read from memory
mutex | in: mutex |
UNIV_INLINE void mutex_reset_lock_word | ( | ib_mutex_t * | mutex | ) |
Performs a reset instruction to the lock_word field of a mutex. This instruction also serializes memory operations to the program order.
mutex | in: mutex |
UNIV_INTERN void mutex_set_debug_info | ( | ib_mutex_t * | mutex, |
const char * | file_name, | ||
ulint | line | ||
) |
Sets the debug information for a reserved mutex. in: line where requested
mutex | in: mutex |
file_name | in: file where requested |
UNIV_INTERN void mutex_set_waiters | ( | ib_mutex_t * | mutex, |
ulint | n | ||
) |
Sets the waiters field in a mutex. in: value to set
mutex | in: mutex |
UNIV_INTERN void mutex_signal_object | ( | ib_mutex_t * | mutex | ) |
Releases the threads waiting in the primary wait array for this mutex. in: mutex
UNIV_INTERN void mutex_spin_wait | ( | ib_mutex_t * | mutex, |
const char * | file_name, | ||
ulint | line | ||
) |
Reserves a mutex for the current thread. If the mutex is reserved, the function spins a preset time (controlled by SYNC_SPIN_ROUNDS) waiting for the mutex before suspending the thread. in: line where requested
mutex | in: pointer to mutex |
file_name | in: file name where mutex requested |
UNIV_INLINE void os_atomic_dec_ulint_func | ( | ib_mutex_t * | mutex, |
volatile ulint * | var, | ||
ulint | delta | ||
) |
Function that uses a mutex to decrement a variable atomically
mutex | in: mutex guarding the dec |
var | in/out: variable to decrement |
delta | in: delta to decrement |
UNIV_INLINE void os_atomic_inc_ulint_func | ( | ib_mutex_t * | mutex, |
volatile ulint * | var, | ||
ulint | delta | ||
) |
Function that uses a mutex to increment a variable atomically
mutex | in: mutex guarding the increment |
var | in/out: variable to increment |
delta | in: delta to increment |