evthread_lock_callbacks

This structure describes the interface a threading library uses for locking. It's used to tell evthread_set_lock_callbacks() how to use locking on this platform.

Members

Variables

alloc
ExternC!(void* function(uint locktype)) alloc;

Function to allocate and initialize new lock of type 'locktype'. * Returns NULL on failure.

free
ExternC!(void function(void* lock, uint locktype)) free;

Funtion to release all storage held in 'lock', which was created * with type 'locktype'.

lock
ExternC!(int function(uint mode, void* lock)) lock;

Acquire an already-allocated lock at 'lock' with mode 'mode'. * Returns 0 on success, and nonzero on failure.

lock_api_version
int lock_api_version;

The current version of the locking API. Set this to * EVTHREAD_LOCK_API_VERSION

supported_locktypes
uint supported_locktypes;

Which kinds of locks does this version of the locking API support? A bitfield of EVTHREAD_LOCKTYPE_RECURSIVE and EVTHREAD_LOCKTYPE_READWRITE.

unlock
ExternC!(int function(uint mode, void* lock)) unlock;

Release a lock at 'lock' using mode 'mode'. Returns 0 on success, * and nonzero on failure.

Meta