pl-nk v0.4.5
Plonk|Plink|Plank are a set of cross-platform C/C++ frameworks for audio software development
Typedefs | Functions
Plank SpinLock class
Plank classes

A crossplatform synchronisation utiltiy. More...

Typedefs

typedef struct PlankSpinLock * PlankSpinLockRef
 An opaque reference to the Plank SpinLock object.

Functions

PlankSpinLockRef pl_SpinLock_CreateAndInit ()
 Create and intitialise a Plank SpinLock object and return an oqaque reference to it.
PlankSpinLockRef pl_SpinLock_Create ()
 Create a Plank SpinLock object and return an oqaque reference to it.
PlankResult pl_SpinLock_Init (PlankSpinLockRef p)
 Initialise a Plank SpinLock object.
PlankResult pl_SpinLock_DeInit (PlankSpinLockRef p)
 Deinitialise a Plank SpinLock object.
PlankResult pl_SpinLock_Destroy (PlankSpinLockRef p)
 Destroy a Plank SpinLock object.
void pl_SpinLock_Lock (PlankSpinLockRef p)
 Obtain the lock.
void pl_SpinLock_Unlock (PlankSpinLockRef p)
 Release the lock.
static PlankB pl_SpinLock_TryLock (PlankSpinLockRef p)
 Tries to obtain the lock but doesn't block if this fails.
void pl_SpinLock_Wait (PlankSpinLockRef p)
 Wait on the lock.
void pl_SpinLock_Signal (PlankSpinLockRef p)
 Signal the lock.

Detailed Description

A crossplatform synchronisation utiltiy.


Typedef Documentation

typedef struct PlankSpinLock* PlankSpinLockRef

An opaque reference to the Plank SpinLock object.


Function Documentation

PlankSpinLockRef pl_SpinLock_Create ( )

Create a Plank SpinLock object and return an oqaque reference to it.

Returns:
A Plank SpinLock object as an opaque reference or PLANK_NULL.
PlankSpinLockRef pl_SpinLock_CreateAndInit ( )

Create and intitialise a Plank SpinLock object and return an oqaque reference to it.

Returns:
A Plank SpinLock object as an opaque reference or PLANK_NULL.
PlankResult pl_SpinLock_DeInit ( PlankSpinLockRef  p)

Deinitialise a Plank SpinLock object.

Parameters:
pThe Plank SpinLock object.
Returns:
PlankResult_OK if successful, otherwise an error code.
PlankResult pl_SpinLock_Destroy ( PlankSpinLockRef  p)

Destroy a Plank SpinLock object.

Parameters:
pThe Plank SpinLock object.
Returns:
PlankResult_OK if successful, otherwise an error code.
PlankResult pl_SpinLock_Init ( PlankSpinLockRef  p)

Initialise a Plank SpinLock object.

Parameters:
pThe Plank SpinLock object.
Returns:
PlankResult_OK if successful, otherwise an error code.
void pl_SpinLock_Lock ( PlankSpinLockRef  p)

Obtain the lock.

This will block until the lock can be obtained. Be sure to release the lock using pl_SpinLock_Unlock() otherwise your application will freeze.

Parameters:
pThe Plank SpinLock object.
void pl_SpinLock_Signal ( PlankSpinLockRef  p)

Signal the lock.

[todo docs]

Parameters:
pThe Plank SpinLock object.
static PlankB pl_SpinLock_TryLock ( PlankSpinLockRef  p) [inline, static]

Tries to obtain the lock but doesn't block if this fails.

Parameters:
pThe Plank SpinLock object.
Returns:
true if the lock was obtained, otherwise false.
void pl_SpinLock_Unlock ( PlankSpinLockRef  p)

Release the lock.

Parameters:
pThe Plank SpinLock object.
void pl_SpinLock_Wait ( PlankSpinLockRef  p)

Wait on the lock.

[todo docs]

Parameters:
pThe Plank SpinLock object.
 All Classes Functions Typedefs Enumerations Enumerator Properties