1 .TH "evthread_lock_callbacks" 3 "Tue Jan 27 2015" "libevent" \" -*- nroff -*-
5 evthread_lock_callbacks \-
7 This structure describes the interface a threading library uses for locking\&.
13 \fC#include <thread\&.h>\fP
18 .RI "void *(* \fBalloc\fP )(unsigned locktype)"
20 .RI "\fIFunction to allocate and initialize new lock of type 'locktype'\&. \fP"
22 .RI "void(* \fBfree\fP )(void *\fBlock\fP, unsigned locktype)"
24 .RI "\fIFuntion to release all storage held in 'lock', which was created with type 'locktype'\&. \fP"
26 .RI "int(* \fBlock\fP )(unsigned mode, void *lock)"
28 .RI "\fIAcquire an already-allocated lock at 'lock' with mode 'mode'\&. \fP"
30 .RI "int \fBlock_api_version\fP"
32 .RI "\fIThe current version of the locking API\&. \fP"
34 .RI "unsigned \fBsupported_locktypes\fP"
36 .RI "\fIWhich kinds of locks does this version of the locking API support? A bitfield of EVTHREAD_LOCKTYPE_RECURSIVE and EVTHREAD_LOCKTYPE_READWRITE\&. \fP"
38 .RI "int(* \fBunlock\fP )(unsigned mode, void *\fBlock\fP)"
40 .RI "\fIRelease a lock at 'lock' using mode 'mode'\&. \fP"
42 .SH "Detailed Description"
44 This structure describes the interface a threading library uses for locking\&.
46 It's used to tell \fBevthread_set_lock_callbacks()\fP how to use locking on this platform\&.
47 .SH "Field Documentation"
49 .SS "void*(* evthread_lock_callbacks::alloc)(unsigned locktype)"
52 Function to allocate and initialize new lock of type 'locktype'\&. Returns NULL on failure\&.
53 .SS "void(* evthread_lock_callbacks::free)(void *\fBlock\fP, unsigned locktype)"
56 Funtion to release all storage held in 'lock', which was created with type 'locktype'\&.
57 .SS "int(* evthread_lock_callbacks::lock)(unsigned mode, void *lock)"
60 Acquire an already-allocated lock at 'lock' with mode 'mode'\&. Returns 0 on success, and nonzero on failure\&.
61 .SS "int evthread_lock_callbacks::lock_api_version"
64 The current version of the locking API\&. Set this to EVTHREAD_LOCK_API_VERSION
65 .SS "unsigned evthread_lock_callbacks::supported_locktypes"
68 Which kinds of locks does this version of the locking API support? A bitfield of EVTHREAD_LOCKTYPE_RECURSIVE and EVTHREAD_LOCKTYPE_READWRITE\&. (Note that RECURSIVE locks are currently mandatory, and READWRITE locks are not currently used\&.)
69 .SS "int(* evthread_lock_callbacks::unlock)(unsigned mode, void *\fBlock\fP)"
72 Release a lock at 'lock' using mode 'mode'\&. Returns 0 on success, and nonzero on failure\&.
76 Generated automatically by Doxygen for libevent from the source code\&.