30 #ifndef HAVE_SPINLOCKS 37 #define NUM_EMULATION_SEMAPHORES (NUM_SPINLOCK_SEMAPHORES + NUM_ATOMICS_SEMAPHORES) 39 #define NUM_EMULATION_SEMAPHORES (NUM_SPINLOCK_SEMAPHORES) 46 #define NUM_EMULATION_SEMAPHORES 0 69 #ifndef HAVE_SPINLOCKS 88 for (i = 0; i < nsemas; ++
i)
90 SpinlockSemaArray = spinsemas;
117 elog(
ERROR,
"invalid spinlock number: %d", lockndx);
123 static uint32 counter = 0;
143 idx = (counter++ % sema_total) + offset;
165 elog(
ERROR,
"spin.c does not support S_LOCK_FREE()");
void PGSemaphoreUnlock(PGSemaphore sema)
#define NUM_EMULATION_SEMAPHORES
Size SpinlockSemaSize(void)
Datum idx(PG_FUNCTION_ARGS)
PGSemaphore PGSemaphoreCreate(void)
static void s_check_valid(int lockndx)
void SpinlockSemaInit(void)
void s_unlock_sema(volatile slock_t *lock)
void s_init_lock_sema(volatile slock_t *lock, bool nested)
bool s_lock_free_sema(volatile slock_t *lock)
void * ShmemAllocUnlocked(Size size)
int tas_sema(volatile slock_t *lock)
#define NUM_ATOMICS_SEMAPHORES
struct PGSemaphoreData * PGSemaphore
PGSemaphore * SpinlockSemaArray
bool PGSemaphoreTryLock(PGSemaphore sema)
#define NUM_SPINLOCK_SEMAPHORES