Flutter Engine
The Flutter Engine
Classes | Namespaces | Macros
signal_blocker.h File Reference
#include "platform/assert.h"
#include "platform/globals.h"
#include <pthread.h>
#include <signal.h>

Go to the source code of this file.

Classes

class  dart::ThreadSignalBlocker
 

Namespaces

namespace  dart
 

Macros

#define TEMP_FAILURE_RETRY(expression)
 
#define VOID_TEMP_FAILURE_RETRY(expression)    (static_cast<void>(TEMP_FAILURE_RETRY(expression)))
 
#define NO_RETRY_EXPECTED(expression)
 
#define VOID_NO_RETRY_EXPECTED(expression)    (static_cast<void>(NO_RETRY_EXPECTED(expression)))
 
#define CHECK_IS_BLOCKING(signal)
 
#define TEMP_FAILURE_RETRY_NO_SIGNAL_BLOCKER(expression)
 
#define VOID_TEMP_FAILURE_RETRY_NO_SIGNAL_BLOCKER(expression)    (static_cast<void>(TEMP_FAILURE_RETRY_NO_SIGNAL_BLOCKER(expression)))
 

Macro Definition Documentation

◆ CHECK_IS_BLOCKING

#define CHECK_IS_BLOCKING (   signal)
Value:
({ \
sigset_t signal_mask; \
int __r = pthread_sigmask(SIG_BLOCK, nullptr, &signal_mask); \
USE(__r); \
ASSERT(__r == 0); \
sigismember(&signal_mask, signal); \
})

Definition at line 88 of file signal_blocker.h.

◆ NO_RETRY_EXPECTED

#define NO_RETRY_EXPECTED (   expression)
Value:
({ \
intptr_t __result = (expression); \
if (__result == -1L && errno == EINTR) { \
FATAL("Unexpected EINTR errno"); \
} \
__result; \
})

Definition at line 75 of file signal_blocker.h.

◆ TEMP_FAILURE_RETRY

#define TEMP_FAILURE_RETRY (   expression)
Value:
({ \
ThreadSignalBlocker tsb(SIGPROF); \
intptr_t __result; \
do { \
__result = (expression); \
} while ((__result == -1L) && (errno == EINTR)); \
__result; \
})

Definition at line 58 of file signal_blocker.h.

◆ TEMP_FAILURE_RETRY_NO_SIGNAL_BLOCKER

#define TEMP_FAILURE_RETRY_NO_SIGNAL_BLOCKER (   expression)
Value:
({ \
intptr_t __result; \
ASSERT(CHECK_IS_BLOCKING(SIGPROF)); \
do { \
__result = (expression); \
} while ((__result == -1L) && (errno == EINTR)); \
__result; \
})
#define CHECK_IS_BLOCKING(signal)

Definition at line 99 of file signal_blocker.h.

◆ VOID_NO_RETRY_EXPECTED

#define VOID_NO_RETRY_EXPECTED (   expression)     (static_cast<void>(NO_RETRY_EXPECTED(expression)))

Definition at line 84 of file signal_blocker.h.

◆ VOID_TEMP_FAILURE_RETRY

#define VOID_TEMP_FAILURE_RETRY (   expression)     (static_cast<void>(TEMP_FAILURE_RETRY(expression)))

Definition at line 70 of file signal_blocker.h.

◆ VOID_TEMP_FAILURE_RETRY_NO_SIGNAL_BLOCKER

#define VOID_TEMP_FAILURE_RETRY_NO_SIGNAL_BLOCKER (   expression)     (static_cast<void>(TEMP_FAILURE_RETRY_NO_SIGNAL_BLOCKER(expression)))

Definition at line 109 of file signal_blocker.h.