tbb::queuing_rw_mutex Class Reference
Synchronization

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 33 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 36 of file queuing_rw_mutex.h.

{
q_tail = NULL;
#if TBB_USE_THREADING_TOOLS
internal_construct();
#endif
}

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 44 of file queuing_rw_mutex.h.

{
#if TBB_USE_ASSERT
__TBB_ASSERT( !q_tail, "destruction of an acquired mutex");
#endif
}

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.

{
ITT_SYNC_CREATE(this, _T("tbb::queuing_rw_mutex"), _T(""));
}

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 139 of file queuing_rw_mutex.h.

## is_recursive_mutex

const bool tbb::queuing_rw_mutex::is_recursive_mutex = false

static

Definition at line 138 of file queuing_rw_mutex.h.

## is_rw_mutex

const bool tbb::queuing_rw_mutex::is_rw_mutex = true

static

Definition at line 137 of file queuing_rw_mutex.h.

## q_tail

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

private

The last competitor requesting the lock.

Definition at line 143 of file queuing_rw_mutex.h.

Referenced by tbb::queuing_rw_mutex::scoped_lock::acquire(), queuing_rw_mutex(), tbb::queuing_rw_mutex::scoped_lock::try_acquire(), and ~queuing_rw_mutex().

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

- queuing_rw_mutex.h
- queuing_rw_mutex.cpp

__TBB_ASSERT
#define __TBB_ASSERT(predicate, comment)
No-op version of __TBB_ASSERT.
Definition: tbb_stddef.h:165
tbb::queuing_rw_mutex::internal_construct
void __TBB_EXPORTED_METHOD internal_construct()
Definition: queuing_rw_mutex.cpp:484
ITT_SYNC_CREATE
#define ITT_SYNC_CREATE(obj, type, name)
Definition: itt_notify.h:115
_T
#define _T(string_literal)
Standard Windows style macro to markup the string literals.
Definition: itt_notify.h:59
tbb::queuing_rw_mutex::q_tail
atomic< scoped_lock * > q_tail
The last competitor requesting the lock.
Definition: queuing_rw_mutex.h:143

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