Skip to content

Commit 78fdb1e

Browse files
committed
Mark ParallelMessagePending as sig_atomic_t
ParallelMessagePending was previously marked as a boolean which should be fine on modern platforms, but the C standard recommends the use of sig_atomic_t for variables manipulated in signal handlers. Author: Hayato Kuroda Discussion: https://postgr.es/m/TYAPR01MB58667C15A95A234720F4F876F5529@TYAPR01MB5866.jpnprd01.prod.outlook.com
1 parent e1e6f8f commit 78fdb1e

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/backend/access/transam/parallel.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ typedef struct FixedParallelState
113113
int ParallelWorkerNumber = -1;
114114

115115
/* Is there a parallel message pending which we need to receive? */
116-
volatile bool ParallelMessagePending = false;
116+
volatile sig_atomic_t ParallelMessagePending = false;
117117

118118
/* Are we initializing a parallel worker? */
119119
bool InitializingParallelWorker = false;

src/include/access/parallel.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ typedef struct ParallelWorkerContext
5454
shm_toc *toc;
5555
} ParallelWorkerContext;
5656

57-
extern PGDLLIMPORT volatile bool ParallelMessagePending;
57+
extern PGDLLIMPORT volatile sig_atomic_t ParallelMessagePending;
5858
extern PGDLLIMPORT int ParallelWorkerNumber;
5959
extern PGDLLIMPORT bool InitializingParallelWorker;
6060

0 commit comments

Comments
 (0)