NVBIO
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Methods | List of all members
nvbio::ScopedLock Class Reference

Detailed description

A scoped lock, to be used to protect a code section enclosed within a scope. e.g.

struct MyThreadSafeClass
{
// multi-thread safe section
void foo()
{
bar();
// enter a critical section
{
ScopedLock(&m_mutex);
... // do something
}
}
private:
Mutex m_mutex;
};

Definition at line 179 of file threads.h.

#include <threads.h>

Public Methods

 ScopedLock (Mutex *mutex)
 
 ~ScopedLock ()
 

Constructor & Destructor Documentation

nvbio::ScopedLock::ScopedLock ( Mutex mutex)
inline

Definition at line 182 of file threads.h.

nvbio::ScopedLock::~ScopedLock ( )
inline

Definition at line 183 of file threads.h.


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