Home ⌂Doc Index ◂Up ▴
Intel(R) Threading Building Blocks Doxygen Documentation  version 4.2.3
tbb::internal::circular_doubly_linked_list_with_sentinel Class Reference

Circular doubly-linked list with sentinel. More...

#include <concurrent_monitor.h>

Inheritance diagram for tbb::internal::circular_doubly_linked_list_with_sentinel:
Collaboration diagram for tbb::internal::circular_doubly_linked_list_with_sentinel:

Classes

struct  node_t
 

Public Member Functions

 circular_doubly_linked_list_with_sentinel ()
 
 ~circular_doubly_linked_list_with_sentinel ()
 
size_t size () const
 
bool empty () const
 
node_tfront () const
 
node_tlast () const
 
node_tbegin () const
 
const node_tend () const
 
void add (node_t *n)
 add to the back of the list More...
 
void remove (node_t &n)
 remove node 'n' More...
 
void flush_to (circular_doubly_linked_list_with_sentinel &lst)
 move all elements to 'lst' and initialize the 'this' list More...
 
void clear ()
 

Private Attributes

__TBB_atomic size_t count
 
node_t head
 

Additional Inherited Members

- Private Member Functions inherited from tbb::internal::no_copy
 no_copy (const no_copy &)=delete
 
 no_copy ()=default
 

Detailed Description

Circular doubly-linked list with sentinel.

head.next points to the front and head.prev points to the back

Definition at line 33 of file concurrent_monitor.h.

Constructor & Destructor Documentation

◆ circular_doubly_linked_list_with_sentinel()

tbb::internal::circular_doubly_linked_list_with_sentinel::circular_doubly_linked_list_with_sentinel ( )
inline

Definition at line 42 of file concurrent_monitor.h.

References clear().

Here is the call graph for this function:

◆ ~circular_doubly_linked_list_with_sentinel()

tbb::internal::circular_doubly_linked_list_with_sentinel::~circular_doubly_linked_list_with_sentinel ( )
inline

Member Function Documentation

◆ add()

void tbb::internal::circular_doubly_linked_list_with_sentinel::add ( node_t n)
inline

add to the back of the list

Definition at line 54 of file concurrent_monitor.h.

References tbb::internal::__TBB_load_relaxed(), tbb::internal::__TBB_store_relaxed(), count, head, tbb::internal::circular_doubly_linked_list_with_sentinel::node_t::next, and tbb::internal::circular_doubly_linked_list_with_sentinel::node_t::prev.

Referenced by tbb::internal::concurrent_monitor::notify_relaxed(), and tbb::internal::concurrent_monitor::prepare_wait().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ begin()

node_t* tbb::internal::circular_doubly_linked_list_with_sentinel::begin ( ) const
inline

Definition at line 50 of file concurrent_monitor.h.

References front().

Here is the call graph for this function:

◆ clear()

void tbb::internal::circular_doubly_linked_list_with_sentinel::clear ( )
inline

◆ empty()

bool tbb::internal::circular_doubly_linked_list_with_sentinel::empty ( ) const
inline

Definition at line 47 of file concurrent_monitor.h.

References size().

Referenced by tbb::internal::concurrent_monitor::abort_all_relaxed(), tbb::internal::concurrent_monitor::notify_all_relaxed(), tbb::internal::concurrent_monitor::notify_one_relaxed(), tbb::internal::concurrent_monitor::notify_relaxed(), and tbb::internal::concurrent_monitor::~concurrent_monitor().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ end()

const node_t* tbb::internal::circular_doubly_linked_list_with_sentinel::end ( ) const
inline

Definition at line 51 of file concurrent_monitor.h.

References head.

Referenced by tbb::internal::concurrent_monitor::abort_all_relaxed(), tbb::internal::concurrent_monitor::notify_all_relaxed(), tbb::internal::concurrent_monitor::notify_one_relaxed(), and tbb::internal::concurrent_monitor::notify_relaxed().

Here is the caller graph for this function:

◆ flush_to()

void tbb::internal::circular_doubly_linked_list_with_sentinel::flush_to ( circular_doubly_linked_list_with_sentinel lst)
inline

move all elements to 'lst' and initialize the 'this' list

Definition at line 71 of file concurrent_monitor.h.

71  {
72  if( const size_t l_count = __TBB_load_relaxed(count) ) {
73  __TBB_store_relaxed(lst.count, l_count);
74  lst.head.next = head.next;
75  lst.head.prev = head.prev;
76  head.next->prev = &lst.head;
77  head.prev->next = &lst.head;
78  clear();
79  }
80  }
void __TBB_store_relaxed(volatile T &location, V value)
Definition: tbb_machine.h:739
T __TBB_load_relaxed(const volatile T &location)
Definition: tbb_machine.h:735

References tbb::internal::__TBB_load_relaxed(), tbb::internal::__TBB_store_relaxed(), clear(), count, head, tbb::internal::circular_doubly_linked_list_with_sentinel::node_t::next, and tbb::internal::circular_doubly_linked_list_with_sentinel::node_t::prev.

Referenced by tbb::internal::concurrent_monitor::abort_all_relaxed(), and tbb::internal::concurrent_monitor::notify_all_relaxed().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ front()

node_t* tbb::internal::circular_doubly_linked_list_with_sentinel::front ( ) const
inline

◆ last()

node_t* tbb::internal::circular_doubly_linked_list_with_sentinel::last ( ) const
inline

Definition at line 49 of file concurrent_monitor.h.

References head, and tbb::internal::circular_doubly_linked_list_with_sentinel::node_t::prev.

Referenced by tbb::internal::concurrent_monitor::notify_relaxed().

Here is the caller graph for this function:

◆ remove()

void tbb::internal::circular_doubly_linked_list_with_sentinel::remove ( node_t n)
inline

remove node 'n'

Definition at line 63 of file concurrent_monitor.h.

63  {
64  __TBB_ASSERT( count > 0, "attempt to remove an item from an empty list" );
66  n.prev->next = n.next;
67  n.next->prev = n.prev;
68  }
void __TBB_store_relaxed(volatile T &location, V value)
Definition: tbb_machine.h:739
#define __TBB_ASSERT(predicate, comment)
No-op version of __TBB_ASSERT.
Definition: tbb_stddef.h:165
T __TBB_load_relaxed(const volatile T &location)
Definition: tbb_machine.h:735

References __TBB_ASSERT, tbb::internal::__TBB_load_relaxed(), tbb::internal::__TBB_store_relaxed(), count, tbb::internal::circular_doubly_linked_list_with_sentinel::node_t::next, and tbb::internal::circular_doubly_linked_list_with_sentinel::node_t::prev.

Referenced by tbb::internal::concurrent_monitor::cancel_wait(), tbb::internal::concurrent_monitor::notify_one_relaxed(), and tbb::internal::concurrent_monitor::notify_relaxed().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ size()

size_t tbb::internal::circular_doubly_linked_list_with_sentinel::size ( ) const
inline

Definition at line 46 of file concurrent_monitor.h.

References count.

Referenced by empty().

Here is the caller graph for this function:

Member Data Documentation

◆ count

__TBB_atomic size_t tbb::internal::circular_doubly_linked_list_with_sentinel::count
private

Definition at line 84 of file concurrent_monitor.h.

Referenced by add(), clear(), flush_to(), remove(), and size().

◆ head

node_t tbb::internal::circular_doubly_linked_list_with_sentinel::head
private

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

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.