lock_status_t Struct Reference
[Utility Classes and Functions]

#include <support/SupportDefs.h>

List of all members.


Detailed Description

Locking operation status result.


Public Member Functions

bool is_locked () const
 Did the lock operation succeed?
 lock_status_t (status_t e)
 Constructor for failing to lock.
 lock_status_t (void(*f)(void *), void *d)
 Constructor for successfully holding a lock.
 operator status_t () const
 Conversion operator for status code, synonym for status().
status_t status () const
 B_OK if the lock is held, else an error code.
void unlock () const
 Call to release the lock. May only be called once.

Public Attributes

void(* unlock_func )(void *data)
 unlock function, NULL if lock failed
union {
   void *   data
 locked object if "unlock_func" is non-NULL
   status_t   error
 error if "unlock_func" is NULL
value


Constructor & Destructor Documentation

lock_status_t void(*)(void *)  f,
void *  d
[inline]
 

Constructor for successfully holding a lock.

lock_status_t status_t  e  )  [inline]
 

Constructor for failing to lock.


Member Function Documentation

bool is_locked  )  const [inline]
 

Did the lock operation succeed?

operator status_t  )  const [inline]
 

Conversion operator for status code, synonym for status().

status_t status  )  const [inline]
 

B_OK if the lock is held, else an error code.

void unlock  )  const [inline]
 

Call to release the lock. May only be called once.


Member Data Documentation

void* data
 

locked object if "unlock_func" is non-NULL

status_t error
 

error if "unlock_func" is NULL

void(* unlock_func)(void *data)
 

unlock function, NULL if lock failed

union { ... } value
 


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