Main Page | Modules | Namespace List | Class Hierarchy | Class List | File List | Namespace Members | Class Members | Related Pages

tbb::queuing_mutex::scoped_lock Class Reference

The scoped locking pattern. More...

#include <queuing_mutex.h>

Inherits tbb::internal::no_copy.

Inheritance diagram for tbb::queuing_mutex::scoped_lock:

[legend]
List of all members.

Public Member Functions

 scoped_lock ()
 Construct lock that has not acquired a mutex.
 scoped_lock (queuing_mutex &m)
 Acquire lock on given mutex.
 ~scoped_lock ()
 Release lock (if lock is held).
void acquire (queuing_mutex &m)
 Acquire lock on given mutex.
bool try_acquire (queuing_mutex &m)
 Acquire lock on given mutex if free (i.e. non-blocking).
void release ()
 Release lock.

Detailed Description

The scoped locking pattern.

It helps to avoid the common problem of forgetting to release lock. It also nicely provides the "node" for queuing locks.


Constructor & Destructor Documentation

tbb::queuing_mutex::scoped_lock::scoped_lock  )  [inline]
 

Construct lock that has not acquired a mutex.

Equivalent to zero-initialization of *this.

tbb::queuing_mutex::scoped_lock::scoped_lock queuing_mutex m  )  [inline]
 

Acquire lock on given mutex.

Upon entry, *this should not be in the "have acquired a mutex" state.


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

Copyright © 2005-2008 Intel Corporation. All Rights Reserved.

Intel, Pentium, Intel Xeon, Itanium, Intel XScale and VTune are registered trademarks or trademarks of Intel Corporation or its subsidiaries in the United States and other countries.

* Other names and brands may be claimed as the property of others.