minix/external/bsd/libevent/man/evthread_lock_callbacks.3
David van Moolenbroek e985b92992 Import libevent
Change-Id: Ic75f4cac5eb07ffaba8f97d10673d7d7e2b1762d
2014-10-03 10:00:53 +00:00

76 lines
2.6 KiB
Groff

.TH "evthread_lock_callbacks" 3 "Wed Apr 10 2013" "libevent" \" -*- nroff -*-
.ad l
.nh
.SH NAME
evthread_lock_callbacks \-
.PP
This structure describes the interface a threading library uses for locking\&.
.SH SYNOPSIS
.br
.PP
.PP
\fC#include <thread\&.h>\fP
.SS "Data Fields"
.in +1c
.ti -1c
.RI "void *(* \fBalloc\fP )(unsigned locktype)"
.br
.RI "\fIFunction to allocate and initialize new lock of type 'locktype'\&. \fP"
.ti -1c
.RI "void(* \fBfree\fP )(void *\fBlock\fP, unsigned locktype)"
.br
.RI "\fIFuntion to release all storage held in 'lock', which was created with type 'locktype'\&. \fP"
.ti -1c
.RI "int(* \fBlock\fP )(unsigned mode, void *lock)"
.br
.RI "\fIAcquire an already-allocated lock at 'lock' with mode 'mode'\&. \fP"
.ti -1c
.RI "int \fBlock_api_version\fP"
.br
.RI "\fIThe current version of the locking API\&. \fP"
.ti -1c
.RI "unsigned \fBsupported_locktypes\fP"
.br
.RI "\fIWhich kinds of locks does this version of the locking API support? A bitfield of EVTHREAD_LOCKTYPE_RECURSIVE and EVTHREAD_LOCKTYPE_READWRITE\&. \fP"
.ti -1c
.RI "int(* \fBunlock\fP )(unsigned mode, void *\fBlock\fP)"
.br
.RI "\fIRelease a lock at 'lock' using mode 'mode'\&. \fP"
.in -1c
.SH "Detailed Description"
.PP
This structure describes the interface a threading library uses for locking\&.
It's used to tell \fBevthread_set_lock_callbacks()\fP how to use locking on this platform\&.
.SH "Field Documentation"
.PP
.SS "void*(* evthread_lock_callbacks::alloc)(unsigned locktype)"
.PP
Function to allocate and initialize new lock of type 'locktype'\&. Returns NULL on failure\&.
.SS "void(* evthread_lock_callbacks::free)(void *\fBlock\fP, unsigned locktype)"
.PP
Funtion to release all storage held in 'lock', which was created with type 'locktype'\&.
.SS "int(* evthread_lock_callbacks::lock)(unsigned mode, void *lock)"
.PP
Acquire an already-allocated lock at 'lock' with mode 'mode'\&. Returns 0 on success, and nonzero on failure\&.
.SS "int evthread_lock_callbacks::lock_api_version"
.PP
The current version of the locking API\&. Set this to EVTHREAD_LOCK_API_VERSION
.SS "unsigned evthread_lock_callbacks::supported_locktypes"
.PP
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\&.)
.SS "int(* evthread_lock_callbacks::unlock)(unsigned mode, void *\fBlock\fP)"
.PP
Release a lock at 'lock' using mode 'mode'\&. Returns 0 on success, and nonzero on failure\&.
.SH "Author"
.PP
Generated automatically by Doxygen for libevent from the source code\&.