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_t * | front () const
node_t * | last () const
node_t * | begin () const
const node_t * | end () 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.

{clear();}

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

Definition at line 44 of file concurrent_monitor.h.

{__TBB_ASSERT( head.next==&head && head.prev==&head, "the list is not empty" );}

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

## 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.

{
__TBB_store_relaxed(count, __TBB_load_relaxed(count) + 1);
n->prev = head.prev;
n->next = &head;
head.prev->next = n;
head.prev = n;
}

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.

{return front();}

References front().

Here is the call graph for this function:

## clear()

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

inline

Definition at line 82 of file concurrent_monitor.h.

{head.next = head.prev = &head; __TBB_store_relaxed(count, 0);}

References 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::abort_all_relaxed(), circular_doubly_linked_list_with_sentinel(), flush_to(), tbb::internal::concurrent_monitor::notify_all_relaxed(), and tbb::internal::concurrent_monitor::notify_relaxed().

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

## empty()

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

inline

Definition at line 47 of file concurrent_monitor.h.

{return size()==0;}

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.

{return &head;}

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.

{
if( const size_t l_count = __TBB_load_relaxed(count) ) {
__TBB_store_relaxed(lst.count, l_count);
lst.head.next = head.next;
lst.head.prev = head.prev;
head.next->prev = &lst.head;
head.prev->next = &lst.head;
clear();
}
}

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

Definition at line 48 of file concurrent_monitor.h.

{return head.next;}

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

Referenced by tbb::internal::concurrent_monitor::abort_all_relaxed(), begin(), 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:

## last()

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

inline

Definition at line 49 of file concurrent_monitor.h.

{return head.prev;}

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.

{
__TBB_ASSERT( count > 0, "attempt to remove an item from an empty list" );
__TBB_store_relaxed(count, __TBB_load_relaxed(count) - 1);
n.prev->next = n.next;
n.next->prev = n.prev;
}

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.

{return count;}

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

Definition at line 85 of file concurrent_monitor.h.

Referenced by add(), clear(), end(), flush_to(), front(), last(), and ~circular_doubly_linked_list_with_sentinel().

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

- concurrent_monitor.h

tbb::internal::circular_doubly_linked_list_with_sentinel::count
__TBB_atomic size_t count
Definition: concurrent_monitor.h:84
tbb::internal::circular_doubly_linked_list_with_sentinel::head
node_t head
Definition: concurrent_monitor.h:85
__TBB_ASSERT
#define __TBB_ASSERT(predicate, comment)
No-op version of __TBB_ASSERT.
Definition: tbb_stddef.h:165
tbb::internal::circular_doubly_linked_list_with_sentinel::front
node_t * front() const
Definition: concurrent_monitor.h:48
tbb::internal::circular_doubly_linked_list_with_sentinel::size
size_t size() const
Definition: concurrent_monitor.h:46
tbb::internal::circular_doubly_linked_list_with_sentinel::node_t::next
node_t * next
Definition: concurrent_monitor.h:36
tbb::internal::__TBB_store_relaxed
void __TBB_store_relaxed(volatile T &location, V value)
Definition: tbb_machine.h:742
tbb::internal::circular_doubly_linked_list_with_sentinel::node_t::prev
node_t * prev
Definition: concurrent_monitor.h:37
tbb::internal::circular_doubly_linked_list_with_sentinel::clear
void clear()
Definition: concurrent_monitor.h:82
tbb::internal::__TBB_load_relaxed
T __TBB_load_relaxed(const volatile T &location)
Definition: tbb_machine.h:738

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.