Intel(R) Threading Building Blocks Doxygen Documentation  version 4.2.3
tbb::queuing_rw_mutex Class Reference

Queuing reader-writer mutex with local-only spinning. More...

#include <queuing_rw_mutex.h>

Inheritance diagram for tbb::queuing_rw_mutex:
Collaboration diagram for tbb::queuing_rw_mutex:

Classes

class  scoped_lock
 The scoped locking pattern. More...
 

Public Member Functions

 queuing_rw_mutex ()
 Construct unacquired mutex. More...
 
 ~queuing_rw_mutex ()
 Destructor asserts if the mutex is acquired, i.e. q_tail is non-NULL. More...
 
void __TBB_EXPORTED_METHOD internal_construct ()
 

Static Public Attributes

static const bool is_rw_mutex = true
 
static const bool is_recursive_mutex = false
 
static const bool is_fair_mutex = true
 

Private Attributes

atomic< scoped_lock * > q_tail
 The last competitor requesting the lock. More...
 

Detailed Description

Queuing reader-writer mutex with local-only spinning.

Adapted from Krieger, Stumm, et al. pseudocode at http://www.eecg.toronto.edu/parallel/pubs_abs.html#Krieger_etal_ICPP93

Definition at line 30 of file queuing_rw_mutex.h.

Constructor & Destructor Documentation

◆ queuing_rw_mutex()

tbb::queuing_rw_mutex::queuing_rw_mutex ( )
inline

Construct unacquired mutex.

Definition at line 33 of file queuing_rw_mutex.h.

33  {
34  q_tail = NULL;
35 #if TBB_USE_THREADING_TOOLS
37 #endif
38  }
atomic< scoped_lock * > q_tail
The last competitor requesting the lock.
void __TBB_EXPORTED_METHOD internal_construct()

References internal_construct(), and q_tail.

Here is the call graph for this function:

◆ ~queuing_rw_mutex()

tbb::queuing_rw_mutex::~queuing_rw_mutex ( )
inline

Destructor asserts if the mutex is acquired, i.e. q_tail is non-NULL.

Definition at line 41 of file queuing_rw_mutex.h.

41  {
42 #if TBB_USE_ASSERT
43  __TBB_ASSERT( !q_tail, "destruction of an acquired mutex");
44 #endif
45  }
#define __TBB_ASSERT(predicate, comment)
No-op version of __TBB_ASSERT.
Definition: tbb_stddef.h:165
atomic< scoped_lock * > q_tail
The last competitor requesting the lock.

References __TBB_ASSERT, and q_tail.

Member Function Documentation

◆ internal_construct()

void tbb::queuing_rw_mutex::internal_construct ( )

Definition at line 484 of file queuing_rw_mutex.cpp.

484  {
485  ITT_SYNC_CREATE(this, _T("tbb::queuing_rw_mutex"), _T(""));
486 }
#define ITT_SYNC_CREATE(obj, type, name)
Definition: itt_notify.h:119
#define _T(string_literal)
Standard Windows style macro to markup the string literals.
Definition: itt_notify.h:62

References _T, and ITT_SYNC_CREATE.

Referenced by queuing_rw_mutex().

Here is the caller graph for this function:

Member Data Documentation

◆ is_fair_mutex

const bool tbb::queuing_rw_mutex::is_fair_mutex = true
static

Definition at line 136 of file queuing_rw_mutex.h.

◆ is_recursive_mutex

const bool tbb::queuing_rw_mutex::is_recursive_mutex = false
static

Definition at line 135 of file queuing_rw_mutex.h.

◆ is_rw_mutex

const bool tbb::queuing_rw_mutex::is_rw_mutex = true
static

Definition at line 134 of file queuing_rw_mutex.h.

◆ q_tail

atomic<scoped_lock*> tbb::queuing_rw_mutex::q_tail
private

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

Copyright © 2005-2019 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.