OpenMPI 0.1.1

- Main Page
- Related Pages
- Modules
- Data Structures
- Files

- Data Structures
- Class Hierarchy
- Data Fields

Data Fields
evthread_lock_callbacks Struct Reference

This structure describes the interface a threading library uses for locking. More...

`#include <thread.h>`

## Data Fields
int | lock_api_version
| The current version of the locking API. More...
unsigned | supported_locktypes
| Which kinds of locks does this version of the locking API support? A bitfield of EVTHREAD_LOCKTYPE_RECURSIVE and EVTHREAD_LOCKTYPE_READWRITE. More...
void *(* | alloc )(unsigned locktype)
| Function to allocate and initialize new lock of type 'locktype'. More...
void(* | free )(void *lock, unsigned locktype)
| Funtion to release all storage held in 'lock', which was created with type 'locktype'. More...
int(* | lock )(unsigned mode, void *lock)
| Acquire an already-allocated lock at 'lock' with mode 'mode'. More...
int(* | unlock )(unsigned mode, void *lock)
| Release a lock at 'lock' using mode 'mode'. More...

## Detailed Description

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.

## Field Documentation

void*(* evthread_lock_callbacks::alloc)(unsigned locktype)

Function to allocate and initialize new lock of type 'locktype'.

Returns NULL on failure.

Referenced by evthread_set_lock_callbacks().

void(* evthread_lock_callbacks::free)(void *lock, unsigned locktype)

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

Referenced by evthread_set_lock_callbacks().

int(* evthread_lock_callbacks::lock)(unsigned mode, void *lock)

Acquire an already-allocated lock at 'lock' with mode 'mode'.

Returns 0 on success, and nonzero on failure.

Referenced by evthread_set_lock_callbacks().

int evthread_lock_callbacks::lock_api_version

The current version of the locking API.

Set this to EVTHREAD_LOCK_API_VERSION

unsigned evthread_lock_callbacks::supported_locktypes

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.)

int(* evthread_lock_callbacks::unlock)(unsigned mode, void *lock)

Release a lock at 'lock' using mode 'mode'.

Returns 0 on success, and nonzero on failure.

Referenced by evthread_set_lock_callbacks().

The documentation for this struct was generated from the following file:

- opal/mca/event/libevent2013/libevent/include/event2/thread.h