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

A crossplatform synchronisation utiltiy. More...

Typedefs

typedef struct
PlankThreadSpinLock * 
PlankThreadSpinLockRef
 An opaque reference to the Plank ThreadSpinLock object.

Functions

PlankThreadSpinLockRef pl_ThreadSpinLock_CreateAndInit ()
 Create and intitialise a Plank ThreadSpinLock object and return an oqaque reference to it.
PlankThreadSpinLockRef pl_ThreadSpinLock_Create ()
 Create a Plank ThreadSpinLock object and return an oqaque reference to it.
PlankResult pl_ThreadSpinLock_Init (PlankThreadSpinLockRef p)
 Initialise a Plank ThreadSpinLock object.
PlankResult pl_ThreadSpinLock_DeInit (PlankThreadSpinLockRef p)
 Deinitialise a Plank ThreadSpinLock object.
PlankResult pl_ThreadSpinLock_Destroy (PlankThreadSpinLockRef p)
 Destroy a Plank ThreadSpinLock object.
void pl_ThreadSpinLock_Lock (PlankThreadSpinLockRef p)
 Obtain the lock.
PlankB pl_ThreadSpinLock_Unlock (PlankThreadSpinLockRef p)
 Release the lock.
static PlankB pl_ThreadSpinLock_TryLock (PlankThreadSpinLockRef p)
 Tries to obtain the lock but doesn't block if this fails.
void pl_ThreadSpinLock_Wait (PlankThreadSpinLockRef p)
 Wait on the lock.
void pl_ThreadSpinLock_Signal (PlankThreadSpinLockRef p)
 Signal the lock.

Detailed Description

A crossplatform synchronisation utiltiy.


Typedef Documentation

typedef struct PlankThreadSpinLock* PlankThreadSpinLockRef

An opaque reference to the Plank ThreadSpinLock object.


Function Documentation

PlankThreadSpinLockRef pl_ThreadSpinLock_Create ( )

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

Returns:
A Plank ThreadSpinLock object as an opaque reference or PLANK_NULL.
PlankThreadSpinLockRef pl_ThreadSpinLock_CreateAndInit ( )

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

Returns:
A Plank ThreadSpinLock object as an opaque reference or PLANK_NULL.
PlankResult pl_ThreadSpinLock_DeInit ( PlankThreadSpinLockRef  p)

Deinitialise a Plank ThreadSpinLock object.

Parameters:
pThe Plank ThreadSpinLock object.
Returns:
PlankResult_OK if successful, otherwise an error code.
PlankResult pl_ThreadSpinLock_Destroy ( PlankThreadSpinLockRef  p)

Destroy a Plank ThreadSpinLock object.

Parameters:
pThe Plank ThreadSpinLock object.
Returns:
PlankResult_OK if successful, otherwise an error code.
PlankResult pl_ThreadSpinLock_Init ( PlankThreadSpinLockRef  p)

Initialise a Plank ThreadSpinLock object.

Parameters:
pThe Plank ThreadSpinLock object.
Returns:
PlankResult_OK if successful, otherwise an error code.
void pl_ThreadSpinLock_Lock ( PlankThreadSpinLockRef  p)

Obtain the lock.

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

Parameters:
pThe Plank ThreadSpinLock object.
void pl_ThreadSpinLock_Signal ( PlankThreadSpinLockRef  p)

Signal the lock.

[todo docs]

Parameters:
pThe Plank ThreadSpinLock object.
static PlankB pl_ThreadSpinLock_TryLock ( PlankThreadSpinLockRef  p) [inline, static]

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

Parameters:
pThe Plank ThreadSpinLock object.
Returns:
true if the lock was obtained, otherwise false.
PlankB pl_ThreadSpinLock_Unlock ( PlankThreadSpinLockRef  p)

Release the lock.

Parameters:
pThe Plank ThreadSpinLock object.
Returns:
Returns PLANK_TRUE if the lock was unlocked.
void pl_ThreadSpinLock_Wait ( PlankThreadSpinLockRef  p)

Wait on the lock.

[todo docs]

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