Tervel
1.0.0
A collection of wait-free containers and algorithms.
|
Defines a list of objects which are stored until they are safe to be freed. More...
#include <hp_list.h>
Public Member Functions | |
ElementList (ListManager *manager) | |
~ElementList () | |
Public Attributes | |
friend | Element |
Private Member Functions | |
void | send_to_manager () |
Sends all elements managed by this list to the parent. More... | |
void | add_to_unsafe (Element *elem) |
This function adds an Element to the unsafe list. More... | |
void | try_to_free_elements (bool dont_check=false) |
Tries to free elements from the unsafe list. More... | |
Private Attributes | |
ListManager * | manager_ |
This list's manager. More... | |
Element * | element_list_ {nullptr} |
A linked list of list elements. More... | |
Defines a list of objects which are stored until they are safe to be freed.
The list is represented as a linked list of HP Elements
Further, this object has a parent who is shared amongst other threads. When it is to be destroyed, it sends its remaining elements to the parent, relinquishing ownership of said elements.
|
inlineexplicit |
|
inline |
|
private |
This function adds an Element to the unsafe list.
elem | The element to add |
|
private |
Sends all elements managed by this list to the parent.
|
private |
Tries to free elements from the unsafe list.
dont_check | If true, it ignores safety checks |
friend tervel::util::memory::hp::ElementList::Element |
|
private |
A linked list of list elements.
Elements are freed when they are no longer referenced by other threads.
|
private |
This list's manager.