1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
/*-------------------------------------------------------------------------
*
* 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-2020, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/storage/pg_sema.h
*
*-------------------------------------------------------------------------
*/
/*
* struct 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; hence, PGSemaphoreData is declared as an opaque struct here.
*
* However, Windows is sufficiently unlike our other ports that it doesn't
* seem worth insisting on ABI compatibility for Windows too. Hence, on
* that platform just define PGSemaphore as HANDLE.
*/
typedef struct PGSemaphoreData *PGSemaphore;
typedef HANDLE PGSemaphore;
/* Report amount of shared memory needed */
extern Size ;
/* Module initialization (called during postmaster start or shmem reinit) */
extern void ;
/* Allocate a PGSemaphore structure with initial count 1 */
extern PGSemaphore ;
/* Reset a previously-initialized PGSemaphore to have count 0 */
extern void ;
/* Lock a semaphore (decrement count), blocking if count would be < 0 */
extern void ;
/* Unlock a semaphore (increment count) */
extern void ;
/* Lock a semaphore only if able to do so without blocking */
extern bool ;
/* PG_SEMA_H */