|
PostgreSQL Source Code git master
|

Go to the source code of this file.
Data Structures | |
| struct | SpinDelayStatus |
Macros | |
| #define | S_LOCK(lock) (TAS(lock) ? s_lock((lock), __FILE__, __LINE__, __func__) : 0) |
| #define | S_LOCK_FREE(lock) (*(lock) == 0) |
| #define | USE_DEFAULT_S_UNLOCK |
| #define | S_UNLOCK(lock) s_unlock(lock) |
| #define | S_INIT_LOCK(lock) S_UNLOCK(lock) |
| #define | SPIN_DELAY() ((void) 0) |
| #define | TAS(lock) tas(lock) |
| #define | TAS_SPIN(lock) TAS(lock) |
| #define | DEFAULT_SPINS_PER_DELAY 100 |
| #define | init_local_spin_delay(status) init_spin_delay(status, __FILE__, __LINE__, __func__) |
Functions | |
| void | s_unlock (volatile slock_t *lock) |
| int | tas (volatile slock_t *lock) |
| int | s_lock (volatile slock_t *lock, const char *file, int line, const char *func) |
| void | set_spins_per_delay (int shared_spins_per_delay) |
| int | update_spins_per_delay (int shared_spins_per_delay) |
| static void | init_spin_delay (SpinDelayStatus *status, const char *file, int line, const char *func) |
| void | perform_spin_delay (SpinDelayStatus *status) |
| void | finish_spin_delay (SpinDelayStatus *status) |
| #define init_local_spin_delay | ( | status | ) | init_spin_delay(status, __FILE__, __LINE__, __func__) |
| void finish_spin_delay | ( | SpinDelayStatus * | status | ) |
Definition at line 186 of file s_lock.c.
References SpinDelayStatus::cur_delay, Max, MAX_SPINS_PER_DELAY, Min, MIN_SPINS_PER_DELAY, and spins_per_delay.
Referenced by LockBufHdr(), LWLockWaitListLock(), s_lock(), and WaitBufHdrUnlocked().
|
inlinestatic |
Definition at line 722 of file s_lock.h.
References SpinDelayStatus::cur_delay, SpinDelayStatus::delays, SpinDelayStatus::file, SpinDelayStatus::func, SpinDelayStatus::line, and SpinDelayStatus::spins.
Referenced by s_lock().
| void perform_spin_delay | ( | SpinDelayStatus * | status | ) |
Definition at line 126 of file s_lock.c.
References SpinDelayStatus::cur_delay, SpinDelayStatus::delays, SpinDelayStatus::file, fprintf, SpinDelayStatus::func, SpinDelayStatus::line, MAX_DELAY_USEC, MIN_DELAY_USEC, NUM_DELAYS, pg_global_prng_state, pg_prng_double(), pg_usleep(), pgstat_report_wait_end(), pgstat_report_wait_start(), s_lock_stuck(), SPIN_DELAY, SpinDelayStatus::spins, spins_per_delay, and generate_unaccent_rules::stdout.
Referenced by LockBufHdr(), LWLockWaitListLock(), s_lock(), and WaitBufHdrUnlocked().
| int s_lock | ( | volatile slock_t * | lock, |
| const char * | file, | ||
| int | line, | ||
| const char * | func | ||
| ) |
Definition at line 98 of file s_lock.c.
References SpinDelayStatus::delays, finish_spin_delay(), init_spin_delay(), perform_spin_delay(), and TAS_SPIN.
Referenced by test_spinlock().
| void s_unlock | ( | volatile slock_t * | lock | ) |
| void set_spins_per_delay | ( | int | shared_spins_per_delay | ) |
Definition at line 207 of file s_lock.c.
References spins_per_delay.
Referenced by InitAuxiliaryProcess(), and InitProcess().
| int tas | ( | volatile slock_t * | lock | ) |
| int update_spins_per_delay | ( | int | shared_spins_per_delay | ) |
Definition at line 218 of file s_lock.c.
References spins_per_delay.
Referenced by AuxiliaryProcKill(), and ProcKill().