2022-11-05 01:19:05 +00:00
|
|
|
#ifndef COSMOPOLITAN_LIBC_CALLS_BLOCKCANCEL_H_
|
|
|
|
#define COSMOPOLITAN_LIBC_CALLS_BLOCKCANCEL_H_
|
|
|
|
#include "libc/thread/thread.h"
|
|
|
|
#if !(__ASSEMBLER__ + __LINKER__ + 0)
|
|
|
|
COSMOPOLITAN_C_START_
|
|
|
|
|
|
|
|
#define BLOCK_CANCELLATIONS \
|
|
|
|
do { \
|
|
|
|
int _CancelState; \
|
2022-11-06 02:49:41 +00:00
|
|
|
_CancelState = _pthread_block_cancellations()
|
2022-11-05 01:19:05 +00:00
|
|
|
|
2022-11-06 02:49:41 +00:00
|
|
|
#define ALLOW_CANCELLATIONS \
|
|
|
|
_pthread_allow_cancellations(_CancelState); \
|
|
|
|
} \
|
2022-11-05 01:19:05 +00:00
|
|
|
while (0)
|
|
|
|
|
2022-11-06 02:49:41 +00:00
|
|
|
int _pthread_block_cancellations(void);
|
|
|
|
void _pthread_allow_cancellations(int);
|
|
|
|
|
2022-11-05 01:19:05 +00:00
|
|
|
COSMOPOLITAN_C_END_
|
|
|
|
#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */
|
|
|
|
#endif /* COSMOPOLITAN_LIBC_CALLS_BLOCKCANCEL_H_ */
|