PostgreSQL Source Code
git master
|
#include "postgres.h"
#include "storage/pg_sema.h"
#include "storage/shmem.h"
#include "storage/spin.h"
Go to the source code of this file.
Macros | |
#define | NUM_EMULATION_SEMAPHORES (NUM_SPINLOCK_SEMAPHORES + NUM_ATOMICS_SEMAPHORES) |
Functions | |
Size | SpinlockSemaSize (void) |
int | SpinlockSemas (void) |
void | SpinlockSemaInit (void) |
static void | s_check_valid (int lockndx) |
void | s_init_lock_sema (volatile slock_t *lock, bool nested) |
void | s_unlock_sema (volatile slock_t *lock) |
bool | s_lock_free_sema (volatile slock_t *lock) |
int | tas_sema (volatile slock_t *lock) |
Variables | |
PGSemaphore * | SpinlockSemaArray |
#define NUM_EMULATION_SEMAPHORES (NUM_SPINLOCK_SEMAPHORES + NUM_ATOMICS_SEMAPHORES) |
|
inlinestatic |
Definition at line 114 of file spin.c.
References elog(), ERROR, NUM_EMULATION_SEMAPHORES, and unlikely.
Referenced by s_init_lock_sema(), s_unlock_sema(), and tas_sema().
Definition at line 121 of file spin.c.
References idx(), NUM_ATOMICS_SEMAPHORES, NUM_SPINLOCK_SEMAPHORES, and s_check_valid().
Referenced by pg_atomic_init_flag_impl(), pg_atomic_init_u32_impl(), and pg_atomic_init_u64_impl().
void s_unlock_sema | ( | volatile slock_t * | lock | ) |
Definition at line 152 of file spin.c.
References PGSemaphoreUnlock(), s_check_valid(), and SpinlockSemaArray.
void SpinlockSemaInit | ( | void | ) |
Definition at line 77 of file spin.c.
References i, PGSemaphoreCreate(), ShmemAllocUnlocked(), SpinlockSemaArray, SpinlockSemas(), and SpinlockSemaSize().
Referenced by CreateSharedMemoryAndSemaphores().
int SpinlockSemas | ( | void | ) |
Definition at line 64 of file spin.c.
References NUM_EMULATION_SEMAPHORES.
Referenced by CalculateShmemSize(), and SpinlockSemaInit().
Size SpinlockSemaSize | ( | void | ) |
Definition at line 55 of file spin.c.
References NUM_EMULATION_SEMAPHORES.
Referenced by CalculateShmemSize(), and SpinlockSemaInit().
int tas_sema | ( | volatile slock_t * | lock | ) |
Definition at line 170 of file spin.c.
References PGSemaphoreTryLock(), s_check_valid(), and SpinlockSemaArray.
PGSemaphore* SpinlockSemaArray |
Definition at line 42 of file spin.c.
Referenced by s_unlock_sema(), SpinlockSemaInit(), and tas_sema().