libclod
C library for interacting with NBTs, region files, LOD data and other things.
Loading...
Searching...
No Matches
futex.h File Reference
#include <clod/lib.h>

Go to the source code of this file.

Enumerations

enum  clod_futex_error { CLOD_FUTEX_OK = 0 , CLOD_FUTEX_INVALID = 1 , CLOD_FUTEX_INTERRUPT = 2 }

Functions

enum clod_futex_error clod_futex_wait (const int *ptr, int expected, int64_t timeout_us)
enum clod_futex_error clod_futex_wake_one (const int *ptr)
enum clod_futex_error clod_futex_wake_all (const int *ptr)

Detailed Description

Methods relating to futexes. For example, clod/thread.h uses this to implement some synchronisation primitives.

Definition in file futex.h.

Enumeration Type Documentation

◆ clod_futex_error

Enumerator
CLOD_FUTEX_OK 

No worries.

CLOD_FUTEX_INVALID 

Invalid usage i.e. argument, pointer.

CLOD_FUTEX_INTERRUPT 

The operation was interrupted by a signal.

Definition at line 13 of file futex.h.

Function Documentation

◆ clod_futex_wait()

enum clod_futex_error clod_futex_wait ( const int * ptr,
int expected,
int64_t timeout_us )

Definition at line 6 of file futex.c.

◆ clod_futex_wake_one()

enum clod_futex_error clod_futex_wake_one ( const int * ptr)

Definition at line 20 of file futex.c.

◆ clod_futex_wake_all()

enum clod_futex_error clod_futex_wake_all ( const int * ptr)

Definition at line 28 of file futex.c.