.TH "SbThreadAutoLock" 3 "Wed May 23 2012" "Version 3.1.3" "Coin" \" -*- nroff -*- .ad l .nh .SH NAME SbThreadAutoLock \- .PP Simple convenience class for locking access to a function\&. .PP This class provides a simple convenience mechanism for automatically locking access to a function that is not re-entrant\&. .SH SYNOPSIS .br .PP .PP \fC#include \fP .SS "Public Member Functions" .in +1c .ti -1c .RI "\fBSbThreadAutoLock\fP (\fBSbMutex\fP *mutexptr)" .br .ti -1c .RI "\fBSbThreadAutoLock\fP (SbThreadMutex *mutexptr)" .br .ti -1c .RI "\fB~SbThreadAutoLock\fP ()" .br .in -1c .SS "Protected Attributes" .in +1c .ti -1c .RI "\fBSbMutex\fP * \fBmutex\fP" .br .ti -1c .RI "SbThreadMutex * \fBrecmutex\fP" .br .in -1c .SH "Detailed Description" .PP Simple convenience class for locking access to a function\&. .PP This class provides a simple convenience mechanism for automatically locking access to a function that is not re-entrant\&. Usage example: .PP .PP .nf void myfunction(void) { SbThreadAutoLock lock(aMutexPtr); // [other code] } .fi .PP .PP In the class constructor, \fBSbMutex::lock()\fP is called on the mutex, and when the function exits (this is the convenience part) the destructor will automatically be invoked, calling \fBSbMutex::unlock()\fP on the same mutex\&. .SH "Constructor & Destructor Documentation" .PP .SS "SbThreadAutoLock::SbThreadAutoLock (\fBSbMutex\fP *mutex)\fC [inline]\fP" The constructor calls \fBSbMutex::lock()\fP on \fImutex\fP\&. .SS "SbThreadAutoLock::SbThreadAutoLock (SbThreadMutex *mutex)\fC [inline]\fP" The constructor calls SbThreadMutex::lock() on \fImutex\fP\&. .SS "SbThreadAutoLock::~SbThreadAutoLock ()\fC [inline]\fP" The destructor calls unlock() on the mutex passed in as a parameter to the constructor\&. .SH "Member Data Documentation" .PP .SS "SbThreadAutoLock::recmutex\fC [protected]\fP" \fIThis API member is considered internal to the library, as it is not likely to be of interest to the application programmer\&.\fP .SH "Author" .PP Generated automatically by Doxygen for Coin from the source code\&.