Server IP : 85.214.239.14 / Your IP : 18.221.221.171 Web Server : Apache/2.4.62 (Debian) System : Linux h2886529.stratoserver.net 4.9.0 #1 SMP Tue Jan 9 19:45:01 MSK 2024 x86_64 User : www-data ( 33) PHP Version : 7.4.18 Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare, MySQL : OFF | cURL : OFF | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : OFF Directory : /usr/include/postgresql/9.6/server/storage/ |
Upload File : |
/*------------------------------------------------------------------------- * * pg_sema.h * Platform-independent API for semaphores. * * PostgreSQL requires counting semaphores (the kind that keep track of * multiple unlock operations, and will allow an equal number of subsequent * lock operations before blocking). The underlying implementation is * not the same on every platform. This file defines the API that must * be provided by each port. * * * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * src/include/storage/pg_sema.h * *------------------------------------------------------------------------- */ #ifndef PG_SEMA_H #define PG_SEMA_H /* * PGSemaphoreData and pointer type PGSemaphore are the data structure * representing an individual semaphore. The contents of PGSemaphoreData * vary across implementations and must never be touched by platform- * independent code. PGSemaphoreData structures are always allocated * in shared memory (to support implementations where the data changes during * lock/unlock). * * pg_config.h must define exactly one of the USE_xxx_SEMAPHORES symbols. */ #ifdef USE_NAMED_POSIX_SEMAPHORES #include <semaphore.h> typedef sem_t *PGSemaphoreData; #endif #ifdef USE_UNNAMED_POSIX_SEMAPHORES #include <semaphore.h> typedef sem_t PGSemaphoreData; #endif #ifdef USE_SYSV_SEMAPHORES typedef struct PGSemaphoreData { int semId; /* semaphore set identifier */ int semNum; /* semaphore number within set */ } PGSemaphoreData; #endif #ifdef USE_WIN32_SEMAPHORES typedef HANDLE PGSemaphoreData; #endif typedef PGSemaphoreData *PGSemaphore; /* Module initialization (called during postmaster start or shmem reinit) */ extern void PGReserveSemaphores(int maxSemas, int port); /* Initialize a PGSemaphore structure to represent a sema with count 1 */ extern void PGSemaphoreCreate(PGSemaphore sema); /* Reset a previously-initialized PGSemaphore to have count 0 */ extern void PGSemaphoreReset(PGSemaphore sema); /* Lock a semaphore (decrement count), blocking if count would be < 0 */ extern void PGSemaphoreLock(PGSemaphore sema); /* Unlock a semaphore (increment count) */ extern void PGSemaphoreUnlock(PGSemaphore sema); /* Lock a semaphore only if able to do so without blocking */ extern bool PGSemaphoreTryLock(PGSemaphore sema); #endif /* PG_SEMA_H */