MySQL 5.6.14 Source Code Document
|
Go to the source code of this file.
Classes | |
struct | os_mutex_t |
Functions | |
UNIV_INLINE void | os_cond_init (os_cond_t *cond) |
UNIV_INLINE ibool | os_cond_wait_timed (os_cond_t *cond, os_fast_mutex_t *fast_mutex, const struct timespec *abstime) |
UNIV_INLINE void | os_cond_wait (os_cond_t *cond, os_fast_mutex_t *fast_mutex) |
UNIV_INLINE void | os_cond_broadcast (os_cond_t *cond) |
UNIV_INLINE void | os_cond_signal (os_cond_t *cond) |
UNIV_INLINE void | os_cond_destroy (os_cond_t *cond) |
UNIV_INTERN void | os_sync_init (void) |
UNIV_INTERN void | os_sync_free (void) |
UNIV_INTERN os_event_t | os_event_create (void) |
UNIV_INTERN void | os_event_set (os_event_t event) |
UNIV_INTERN ib_int64_t | os_event_reset (os_event_t event) |
UNIV_INTERN void | os_event_free (os_event_t event) |
UNIV_INTERN void | os_event_wait_low (os_event_t event, ib_int64_t reset_sig_count) |
UNIV_INTERN ulint | os_event_wait_time_low (os_event_t event, ulint time_in_usec, ib_int64_t reset_sig_count) |
UNIV_INTERN os_ib_mutex_t | os_mutex_create (void) |
UNIV_INTERN void | os_mutex_enter (os_ib_mutex_t mutex) |
UNIV_INTERN void | os_mutex_exit (os_ib_mutex_t mutex) |
UNIV_INTERN void | os_mutex_free (os_ib_mutex_t mutex) |
UNIV_INTERN void | os_fast_mutex_init_func (fast_mutex_t *fast_mutex) |
UNIV_INTERN void | os_fast_mutex_lock_func (fast_mutex_t *fast_mutex) |
UNIV_INTERN void | os_fast_mutex_unlock_func (fast_mutex_t *fast_mutex) |
UNIV_INTERN void | os_fast_mutex_free_func (fast_mutex_t *fast_mutex) |
Variables | |
UNIV_INTERN os_ib_mutex_t | os_sync_mutex |
UNIV_INTERN ulint | os_thread_count = 0 |
UNIV_INTERN ulint | os_event_count = 0 |
UNIV_INTERN ulint | os_mutex_count = 0 |
UNIV_INTERN ulint | os_fast_mutex_count = 0 |
The interface to the operating system synchronization primitives.
Created 9/6/1995 Heikki Tuuri
Definition in file os0sync.cc.
UNIV_INLINE void os_cond_broadcast | ( | os_cond_t * | cond | ) |
Wakes all threads waiting for condition variable
cond | in: condition variable. |
Definition at line 222 of file os0sync.cc.
UNIV_INLINE void os_cond_destroy | ( | os_cond_t * | cond | ) |
Destroys condition variable
cond | in: condition variable. |
Definition at line 258 of file os0sync.cc.
UNIV_INLINE void os_cond_init | ( | os_cond_t * | cond | ) |
Initialitze condition variable
cond | in: condition variable. |
Definition at line 118 of file os0sync.cc.
UNIV_INLINE void os_cond_signal | ( | os_cond_t * | cond | ) |
Wakes one thread waiting for condition variable
cond | in: condition variable. |
Definition at line 240 of file os0sync.cc.
UNIV_INLINE void os_cond_wait | ( | os_cond_t * | cond, |
os_fast_mutex_t * | fast_mutex | ||
) |
Wait on condition variable
cond | in: condition variable. |
fast_mutex | in: fast mutex |
Definition at line 201 of file os0sync.cc.
UNIV_INLINE ibool os_cond_wait_timed | ( | os_cond_t * | cond, |
os_fast_mutex_t * | fast_mutex, | ||
const struct timespec * | abstime | ||
) |
Do a timed wait on condition variable.
cond | in: condition variable. |
fast_mutex | in: fast mutex |
abstime | in: timeout |
Definition at line 137 of file os0sync.cc.
UNIV_INTERN os_event_t os_event_create | ( | void | ) |
Creates an event semaphore, i.e., a semaphore which may just have two states: signaled and nonsignaled. The created event is manual reset: it must be reset explicitly by calling sync_os_reset_event.
Definition at line 368 of file os0sync.cc.
UNIV_INTERN void os_event_free | ( | os_event_t | event | ) |
Frees an event object.
event | in: event to free |
Definition at line 532 of file os0sync.cc.
UNIV_INTERN ib_int64_t os_event_reset | ( | os_event_t | event | ) |
Resets an event semaphore to the nonsignaled state. Waiting threads will stop to wait for the event. The return value should be passed to os_even_wait_low() if it is desired that this thread should not wait in case of an intervening call to os_event_set() between this os_event_reset() and the os_event_wait_low() call. See comments for os_event_wait_low().
event | in: event to reset |
Definition at line 469 of file os0sync.cc.
UNIV_INTERN void os_event_set | ( | os_event_t | event | ) |
Sets an event semaphore to the signaled state: lets waiting threads proceed.
event | in: event to set |
Definition at line 433 of file os0sync.cc.
UNIV_INTERN void os_event_wait_low | ( | os_event_t | event, |
ib_int64_t | reset_sig_count | ||
) |
Waits for an event object until it is in the signaled state.
Typically, if the event has been signalled after the os_event_reset() we'll return immediately because event->is_set == TRUE. There are, however, situations (e.g.: sync_array code) where we may lose this information. For example:
thread A calls os_event_reset() thread B calls os_event_set() [event->is_set == TRUE] thread C calls os_event_reset() [event->is_set == FALSE] thread A calls os_event_wait() [infinite wait!] thread C calls os_event_wait() [infinite wait!]
Where such a scenario is possible, to avoid infinite wait, the value returned by os_event_reset() should be passed in as reset_sig_count.
event | in: event to wait |
reset_sig_count | in: zero or the value returned by previous call of os_event_reset(). |
Definition at line 580 of file os0sync.cc.
UNIV_INTERN ulint os_event_wait_time_low | ( | os_event_t | event, |
ulint | time_in_usec, | ||
ib_int64_t | reset_sig_count | ||
) |
Waits for an event object until it is in the signaled state or a timeout is exceeded.
event | in: event to wait |
time_in_usec | in: timeout in microseconds, or OS_SYNC_INFINITE_TIME |
reset_sig_count | in: zero or the value returned by previous call of os_event_reset(). |
Definition at line 626 of file os0sync.cc.
UNIV_INTERN void os_fast_mutex_free_func | ( | fast_mutex_t * | fast_mutex | ) |
Frees a mutex object.
fast_mutex | in: mutex to free |
Definition at line 896 of file os0sync.cc.
UNIV_INTERN void os_fast_mutex_init_func | ( | fast_mutex_t * | fast_mutex | ) |
Initializes an operating system fast mutex semaphore.
fast_mutex | in: fast mutex |
Definition at line 837 of file os0sync.cc.
UNIV_INTERN void os_fast_mutex_lock_func | ( | fast_mutex_t * | fast_mutex | ) |
Acquires ownership of a fast mutex.
fast_mutex | in: mutex to acquire |
Definition at line 866 of file os0sync.cc.
UNIV_INTERN void os_fast_mutex_unlock_func | ( | fast_mutex_t * | fast_mutex | ) |
Releases ownership of a fast mutex.
fast_mutex | in: mutex to release |
Definition at line 881 of file os0sync.cc.
UNIV_INTERN os_ib_mutex_t os_mutex_create | ( | void | ) |
Creates an operating system mutex semaphore. Because these are slow, the mutex semaphore of InnoDB itself (ib_mutex_t) should be used where possible.
Definition at line 738 of file os0sync.cc.
UNIV_INTERN void os_mutex_enter | ( | os_ib_mutex_t | mutex | ) |
Acquires ownership of a mutex semaphore.
mutex | in: mutex to acquire |
Definition at line 775 of file os0sync.cc.
UNIV_INTERN void os_mutex_exit | ( | os_ib_mutex_t | mutex | ) |
Releases ownership of a mutex.
mutex | in: mutex to release |
Definition at line 790 of file os0sync.cc.
UNIV_INTERN void os_mutex_free | ( | os_ib_mutex_t | mutex | ) |
Frees a mutex object.
mutex | in: mutex to free |
Definition at line 806 of file os0sync.cc.
UNIV_INTERN void os_sync_free | ( | void | ) |
Frees created events and OS 'slow' mutexes.
Definition at line 328 of file os0sync.cc.
UNIV_INTERN void os_sync_init | ( | void | ) |
Initializes global event and OS 'slow' mutex lists.
Definition at line 307 of file os0sync.cc.
UNIV_INTERN os_ib_mutex_t os_sync_mutex |
Mutex protecting counts and the lists of OS mutexes and events
Definition at line 55 of file os0sync.cc.
UNIV_INTERN ulint os_thread_count = 0 |
This is incremented by 1 in os_thread_create and decremented by 1 in
os_thread_exit
Definition at line 63 of file os0sync.cc.