Rechercher une page de manuel
SbThreadAutoLock.3coin2
Langue: en
Version: 383535 (fedora - 01/12/10)
Section: 3 (Bibliothèques de fonctions)
NAME
SbThreadAutoLock -Simple convenience class for locking access to a function.
This class provides a simple convenience mechanism for automatically locking access to a function that is not re-entrant.
SYNOPSIS
#include <Inventor/threads/SbThreadAutoLock.h>
Public Member Functions
SbThreadAutoLock (SbMutex *mutexptr)
~SbThreadAutoLock ()
Protected Attributes
SbMutex * mutex
Detailed Description
Simple convenience class for locking access to a function.
This class provides a simple convenience mechanism for automatically locking access to a function that is not re-entrant.
Usage example:
void myfunction(void) { SbThreadAutoLock lock(aMutexPtr); // [other code] }
In the class constructor, SbMutex::lock() is called on the mutex, and when the function exits (this is the convenience part) the destructor will automatically be invoked, calling SbMutex::unlock() on the same mutex.
Constructor & Destructor Documentation
SbThreadAutoLock::SbThreadAutoLock (SbMutex * mutex) [inline]The constructor calls SbMutex::lock() on mutex.
References SbMutex::lock().
SbThreadAutoLock::~SbThreadAutoLock () [inline]The destructor calls unlock() on the mutex passed in as a parameter to the constructor.
References SbMutex::unlock().
Author
Generated automatically by Doxygen for Coin from the source code.
Contenus ©2006-2024 Benjamin Poulain
Design ©2006-2024 Maxime Vantorre