PostgreSQL Source Code
git master
|
Go to the source code of this file.
Typedefs | |
typedef struct PGSemaphoreData * | PGSemaphore |
Functions | |
Size | PGSemaphoreShmemSize (int maxSemas) |
void | PGReserveSemaphores (int maxSemas) |
PGSemaphore | PGSemaphoreCreate (void) |
void | PGSemaphoreReset (PGSemaphore sema) |
void | PGSemaphoreLock (PGSemaphore sema) |
void | PGSemaphoreUnlock (PGSemaphore sema) |
bool | PGSemaphoreTryLock (PGSemaphore sema) |
typedef struct PGSemaphoreData* PGSemaphore |
void PGReserveSemaphores | ( | int | maxSemas | ) |
Definition at line 196 of file posix_sema.c.
References DataDir, elog, ereport, errcode_for_file_access(), errmsg(), FATAL, malloc, maxSemaSets, maxSems, maxSharedSemas, mySemaSets, mySemSet, nextSemaKey, nextSemaNumber, nextSemKey, numSemaSets, numSems, numSharedSemas, on_shmem_exit(), PANIC, PGSemaphoreShmemSize(), ReleaseSemaphores(), SEMAS_PER_SET, sharedSemas, ShmemAllocUnlocked(), stat::st_ino, and stat.
Referenced by CreateSharedMemoryAndSemaphores().
PGSemaphore PGSemaphoreCreate | ( | void | ) |
Definition at line 261 of file posix_sema.c.
References Assert, elog, ereport, errmsg(), IpcSemaphoreCreate(), IpcSemaphoreInitialize(), IsUnderPostmaster, maxSemaSets, maxSems, maxSharedSemas, mySemaSets, mySemSet, nextSemaNumber, numSemaSets, numSems, numSharedSemas, PANIC, PG_SEM_REF, PosixSemaphoreCreate(), SEMAS_PER_SET, PGSemaphoreData::semId, PGSemaphoreData::semNum, and sharedSemas.
Referenced by InitProcGlobal().
void PGSemaphoreLock | ( | PGSemaphore | sema | ) |
Definition at line 319 of file posix_sema.c.
References CHECK_FOR_INTERRUPTS, EINTR, elog, ereport, errmsg(), FATAL, PG_SEM_REF, pgwin32_dispatch_queued_signals(), pgwin32_signal_event, PGSemaphoreData::semId, and PGSemaphoreData::semNum.
Referenced by LWLockAcquire(), LWLockAcquireOrWait(), LWLockDequeueSelf(), LWLockWaitForVar(), ProcArrayGroupClearXid(), and TransactionGroupUpdateXidStatus().
void PGSemaphoreReset | ( | PGSemaphore | sema | ) |
Definition at line 294 of file posix_sema.c.
References EAGAIN, EINTR, elog, FATAL, IpcSemaphoreInitialize(), PG_SEM_REF, PGSemaphoreTryLock(), PGSemaphoreData::semId, and PGSemaphoreData::semNum.
Referenced by InitAuxiliaryProcess(), and InitProcess().
Size PGSemaphoreShmemSize | ( | int | maxSemas | ) |
Definition at line 165 of file posix_sema.c.
References mul_size().
Referenced by CalculateShmemSize(), and PGReserveSemaphores().
bool PGSemaphoreTryLock | ( | PGSemaphore | sema | ) |
Definition at line 364 of file posix_sema.c.
References EAGAIN, EINTR, elog, ereport, errmsg(), EWOULDBLOCK, FATAL, IPC_NOWAIT, PG_SEM_REF, PGSemaphoreData::semId, and PGSemaphoreData::semNum.
Referenced by PGSemaphoreReset().
void PGSemaphoreUnlock | ( | PGSemaphore | sema | ) |
Definition at line 339 of file posix_sema.c.
References EINTR, elog, ereport, errmsg(), FATAL, PG_SEM_REF, PGSemaphoreData::semId, and PGSemaphoreData::semNum.
Referenced by IpcSemaphoreCreate(), LWLockAcquire(), LWLockAcquireOrWait(), LWLockDequeueSelf(), LWLockUpdateVar(), LWLockWaitForVar(), LWLockWakeup(), ProcArrayGroupClearXid(), and TransactionGroupUpdateXidStatus().