BFLibC 0.1
C Library
Loading...
Searching...
No Matches
lock.h File Reference
#include <stdbool.h>
#include "typebftime.h"
Include dependency graph for lock.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define kBFLockTimedWaitCodeTimedOut   0xff
 

Typedefs

typedef void * BFLock
 

Functions

bool BFLockIsValid (BFLock *_lock)
 
int BFLockCreate (BFLock *lock)
 
int BFLockDestroy (BFLock *lock)
 
int BFLockWait (BFLock *lock)
 
bool BFLockIsWaiting (BFLock *l)
 
int BFLockTimedWait (BFLock *l, BFTime t)
 
int BFLockRelease (BFLock *lock)
 
int BFLockLock (BFLock *lock)
 
int BFLockUnlock (BFLock *lock)
 

Macro Definition Documentation

◆ kBFLockTimedWaitCodeTimedOut

#define kBFLockTimedWaitCodeTimedOut   0xff

Typedef Documentation

◆ BFLock

typedef void* BFLock

author: brando date: 10/25/23 Lock object

Capabilities: mutex, conditional wait

Function Documentation

◆ BFLockCreate()

int BFLockCreate ( BFLock * lock)

Caller owns

◆ BFLockDestroy()

int BFLockDestroy ( BFLock * lock)

Releases memory

◆ BFLockIsValid()

bool BFLockIsValid ( BFLock * _lock)

Validates BFLock object

◆ BFLockIsWaiting()

bool BFLockIsWaiting ( BFLock * l)

true if lock is being blocked by BFLockWait

◆ BFLockLock()

int BFLockLock ( BFLock * lock)

Activates a mutex lock

◆ BFLockRelease()

int BFLockRelease ( BFLock * lock)

Releases BFLock waiting on BFLockWait

◆ BFLockTimedWait()

int BFLockTimedWait ( BFLock * l,
BFTime t )

Waits for a specific amount of time before continuing

if elapsed time reaches t, kBFLockTimedWaitCodeTimedOut returns

t : seconds with nanosecond resolution. e.g. 1.0 is one second

◆ BFLockUnlock()

int BFLockUnlock ( BFLock * lock)

Unlocks a mutex lock

◆ BFLockWait()

int BFLockWait ( BFLock * lock)

Waits until BFLockRelease is called on object