MySQL 5.6.14 Source Code Document
|
#include "sync0sync.h"
#include "sync0rw.h"
#include "buf0buf.h"
#include "srv0srv.h"
#include "buf0types.h"
#include "os0sync.h"
#include "ha_prototypes.h"
Go to the source code of this file.
Functions | |
UNIV_INTERN void | mutex_create_func (ib_mutex_t *mutex, const char *cfile_name, ulint cline) |
UNIV_INTERN void | mutex_free_func (ib_mutex_t *mutex) |
UNIV_INTERN ulint | mutex_enter_nowait_func (ib_mutex_t *mutex, const char *file_name __attribute__((unused)), ulint line __attribute__((unused))) |
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_signal_object (ib_mutex_t *mutex) |
UNIV_INTERN void | sync_init (void) |
UNIV_INTERN void | sync_close (void) |
UNIV_INTERN void | sync_print_wait_info (FILE *file) |
UNIV_INTERN void | sync_print (FILE *file) |
Variables | |
UNIV_INTERN ib_int64_t | mutex_exit_count |
UNIV_INTERN ibool | sync_initialized = FALSE |
UNIV_INTERN ut_list_base_node_t | mutex_list |
UNIV_INTERN ib_mutex_t | mutex_list_mutex |
Mutex, the basic synchronization primitive
Created 9/5/1995 Heikki Tuuri
Definition in file sync0sync.cc.
UNIV_INTERN void mutex_create_func | ( | ib_mutex_t * | mutex, |
const char * | cfile_name, | ||
ulint | cline | ||
) |
Creates, or rather, initializes a mutex object in a specified memory location (which must be appropriately aligned). The mutex is initialized in the reset state. Explicit freeing of the mutex with mutex_free is necessary only if the memory block containing it is freed.
mutex | in: pointer to memory |
cfile_name | in: file name where created |
cline | in: file line where created |
Definition at line 263 of file sync0sync.cc.
UNIV_INTERN ulint mutex_enter_nowait_func | ( | ib_mutex_t * | mutex, |
const char *file_name | __attribute__(unused), | ||
ulint line | __attribute__(unused) | ||
) |
NOTE! Use the corresponding macro in the header file, not this function directly. Tries to lock the mutex for the current thread. If the lock is not acquired immediately, returns with return value 1.
mutex | in: pointer to mutex |
__attribute__ | in: file name where mutex requested |
__attribute__ | in: line where requested |
Definition at line 386 of file sync0sync.cc.
UNIV_INTERN void mutex_free_func | ( | ib_mutex_t * | mutex | ) |
NOTE! Use the corresponding macro mutex_free(), not directly this function! Calling this function is obligatory only if the memory buffer containing the mutex is freed. Removes a mutex object from the mutex list. The mutex is checked to be in the reset state.
mutex | in: mutex |
Definition at line 326 of file sync0sync.cc.
UNIV_INTERN void mutex_set_waiters | ( | ib_mutex_t * | mutex, |
ulint | n | ||
) |
Sets the waiters field in a mutex.
mutex | in: mutex |
n | in: value to set |
Definition at line 447 of file sync0sync.cc.
UNIV_INTERN void mutex_signal_object | ( | ib_mutex_t * | mutex | ) |
Releases the threads waiting in the primary wait array for this mutex.
mutex | in: mutex |
Definition at line 589 of file sync0sync.cc.
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.
mutex | in: pointer to mutex |
file_name | in: file name where mutex requested |
line | in: line where requested |
Definition at line 468 of file sync0sync.cc.
UNIV_INTERN void sync_close | ( | void | ) |
Frees the resources in InnoDB's own synchronization data structures. Use os_sync_free() after calling this.
Definition at line 1516 of file sync0sync.cc.
UNIV_INTERN void sync_init | ( | void | ) |
Initializes the synchronization data structures.
Definition at line 1439 of file sync0sync.cc.
UNIV_INTERN void sync_print | ( | FILE * | file | ) |
Prints info of the sync system.
file | in: file where to print |
Definition at line 1594 of file sync0sync.cc.
UNIV_INTERN void sync_print_wait_info | ( | FILE * | file | ) |
Prints wait info of the sync system.
file | in: file where to print |
Definition at line 1556 of file sync0sync.cc.
UNIV_INTERN ib_int64_t mutex_exit_count |
The number of mutex_exit() calls. Intended for performance
monitoring.
Definition at line 183 of file sync0sync.cc.
UNIV_INTERN ut_list_base_node_t mutex_list |
Global list of database mutexes (not OS mutexes) created.
Definition at line 208 of file sync0sync.cc.
UNIV_INTERN ib_mutex_t mutex_list_mutex |
Mutex protecting the mutex_list variable
Definition at line 211 of file sync0sync.cc.
UNIV_INTERN ibool sync_initialized = FALSE |
This variable is set to TRUE when sync_init is called
Definition at line 186 of file sync0sync.cc.