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

A crossplatform synchronisation utiltiy. More...

Typedefs

typedef struct PlankLock * PlankLockRef
 An opaque reference to the Plank Lock object.

Functions

PlankLockRef pl_Lock_CreateAndInit ()
 Create and intitialise a Plank Lock object and return an oqaque reference to it.
PlankLockRef pl_Lock_Create ()
 Create a Plank Lock object and return an oqaque reference to it.
PlankResult pl_Lock_Init (PlankLockRef p)
 Initialise a Plank Lock object.
PlankResult pl_Lock_DeInit (PlankLockRef p)
 Deinitialise a Plank Lock object.
PlankResult pl_Lock_Destroy (PlankLockRef p)
 Destroy a Plank Lock object.
void pl_Lock_Lock (PlankLockRef p)
 Obtain the lock.
void pl_Lock_Unlock (PlankLockRef p)
 Release the lock.
PlankB pl_Lock_TryLock (PlankLockRef p)
 Tries to obtain the lock but doesn't block if this fails.
void pl_Lock_Wait (PlankLockRef p)
 Wait on the lock.
void pl_Lock_Signal (PlankLockRef p)
 Signal the lock.

Detailed Description

A crossplatform synchronisation utiltiy.

This uses a pthread mutex on supported platforms and a CriticalSection on Windows.


Typedef Documentation

typedef struct PlankLock* PlankLockRef

An opaque reference to the Plank Lock object.


Function Documentation

PlankLockRef pl_Lock_Create ( )

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

Returns:
A Plank Lock object as an opaque reference or PLANK_NULL.
PlankLockRef pl_Lock_CreateAndInit ( )

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

Returns:
A Plank Lock object as an opaque reference or PLANK_NULL.
PlankResult pl_Lock_DeInit ( PlankLockRef  p)

Deinitialise a Plank Lock object.

Parameters:
pThe Plank Lock object.
Returns:
PlankResult_OK if successful, otherwise an error code.
PlankResult pl_Lock_Destroy ( PlankLockRef  p)

Destroy a Plank Lock object.

Parameters:
pThe Plank Lock object.
Returns:
PlankResult_OK if successful, otherwise an error code.
PlankResult pl_Lock_Init ( PlankLockRef  p)

Initialise a Plank Lock object.

Parameters:
pThe Plank Lock object.
Returns:
PlankResult_OK if successful, otherwise an error code.
void pl_Lock_Lock ( PlankLockRef  p)

Obtain the lock.

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

Parameters:
pThe Plank Lock object.
void pl_Lock_Signal ( PlankLockRef  p)

Signal the lock.

[todo docs]

Parameters:
pThe Plank Lock object.
PlankB pl_Lock_TryLock ( PlankLockRef  p)

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

Parameters:
pThe Plank Lock object.
Returns:
true if the lock was obtained, otherwise false.
void pl_Lock_Unlock ( PlankLockRef  p)

Release the lock.

Parameters:
pThe Plank Lock object.
void pl_Lock_Wait ( PlankLockRef  p)

Wait on the lock.

[todo docs]

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