typedef union {
void *sig_align;
unsigned char sig_opaque[64];
} sig_mutex;
Opaque buffers sized to hold the largest common pthread backing
type with headroom; sig_thread_posix.c static_asserts this at
compile time so a mismatch fails the build, not silently corrupts
memory.
sig_mutex_attr
typedef union {
void *sig_align;
unsigned char sig_opaque[16];
} sig_mutex_attr;
Opaque buffers sized to hold the largest common pthread backing
type with headroom; sig_thread_posix.c static_asserts this at
compile time so a mismatch fails the build, not silently corrupts
memory.
sig_condition
typedef union {
void *sig_align;
unsigned char sig_opaque[64];
} sig_condition;
Opaque buffers sized to hold the largest common pthread backing
type with headroom; sig_thread_posix.c static_asserts this at
compile time so a mismatch fails the build, not silently corrupts
memory.
sig_rwlock
typedef struct {
sig_mutex mtx;
sig_condition cond;
int readers;
int writer_active;
int writers_waiting;
} sig_rwlock;
Reader/writer lock built from sig_mutex + sig_condition so any port
that provides those two gets it. Many readers or one writer; a
waiting writer blocks new readers, so writers are not starved. Not
recursive.
sig_tls_key
typedef union {
void *sig_align;
unsigned char sig_opaque[16];
} sig_tls_key;
Reader/writer lock built from sig_mutex + sig_condition so any port
that provides those two gets it. Many readers or one writer; a
waiting writer blocks new readers, so writers are not starved. Not
recursive.
sig_thread
typedef union {
void *sig_align;
unsigned char sig_opaque[16];
} sig_thread;
Reader/writer lock built from sig_mutex + sig_condition so any port
that provides those two gets it. Many readers or one writer; a
waiting writer blocks new readers, so writers are not starved. Not
recursive.
Waits on cond until either notified or *abstime (an absolute
CLOCK_MONOTONIC deadline, e.g. from sig_time_now() plus an offset)
is reached. Returns SIG_OK on either a real notify or a timeout --
callers distinguish "did my condition become true" by re-checking
their own state after the call returns, exactly as with
sig_condition_wait(). Returns SIG_ERR_PLATFORM only on a genuine
underlying error.