FBX C++ API Reference
All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
FbxMutex Class Reference

#include <fbxsync.h>

Class Description

Mutually excluding thread lock mechanism.

While the mutex is a much heavier implementation than a spinlock, it supports recursive locking; the same thread can safely lock the same mutex more than once without blocking. But it will have to be released as many times as it as been acquired before other threads can acquire the context. It is sometimes referred as a critical section. This is the heaviest thread lock implementation, but also the most secure.

Definition at line 59 of file fbxsync.h.

Public Member Functions

 FbxMutex (bool pInitialOwnership=false)
 Constructor. More...
 
virtual ~FbxMutex ()
 Destructor. More...
 
void Acquire ()
 Acquire the lock; thread will wait indefinitely until it is available. More...
 
bool TryAcquire (unsigned int pRetryCount)
 Try acquiring the lock; thread will not wait if it is not available. More...
 
void Release ()
 Release the lock; this will allow other threads to acquire the lock if they are waiting. More...
 

Constructor & Destructor Documentation

◆ FbxMutex()

FbxMutex ( bool  pInitialOwnership = false)

Constructor.

Parameters
pInitialOwnershipIf pInitialOwnership is true, the lock will be initialized as being locked by the current thread.

◆ ~FbxMutex()

virtual ~FbxMutex ( )
virtual

Destructor.

Member Function Documentation

◆ Acquire()

void Acquire ( )

Acquire the lock; thread will wait indefinitely until it is available.

Remarks
The same thread can acquire the lock multiple times without blocking.

◆ TryAcquire()

bool TryAcquire ( unsigned int  pRetryCount)

Try acquiring the lock; thread will not wait if it is not available.

Parameters
pRetryCountThe number of retries in case the lock is not available.
Returns
True if the lock is acquired, false otherwise.
Remarks
The same thread can acquire the lock multiple times without blocking.

◆ Release()

void Release ( )

Release the lock; this will allow other threads to acquire the lock if they are waiting.

Remarks
Only the owner thread should call Release(), and it needs to be released as many times as it was acquired.

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