|
| ListLockFree (Allocator &allocator=DefaultAllocator) |
| Default constructor.
|
|
| ListLockFree (const ListLockFree &ref) |
| Copy constructor (not thread-safe for the source list)
|
|
template<size_t N> |
| ListLockFree (const T(&a)[N], Allocator &allocator=DefaultAllocator) |
| Constructor using array.
|
|
T & | back () |
| Provides the last element.
|
|
Iterator | begin () |
|
bool | clear () |
|
bool | empty () |
|
Iterator | end () |
|
bool | erase (Iterator it) |
|
T & | front () |
| Provides the first element.
|
|
bool | insert (Iterator it, const T &data) |
|
T & | operator[] (int index) |
|
bool | pop_back () |
|
bool | pop_back (T &data) |
|
bool | pop_front () |
|
bool | pop_front (T &data) |
|
bool | push_back (const T &data) |
|
bool | push_front (const T &data) |
|
Iterator | rbegin () |
|
Iterator | rend () |
|
void | setAllocator (Allocator &allocator) |
|
size_t | size () |
|
bool | swap (ListLockFree< T > &ref) |
|
template<class T>
class audio_tools::ListLockFree< T >
Lock-free double linked list using atomic operations.
- Author
- Phil Schatzmann
- Copyright
- GPLv3
- Template Parameters
-
This implementation provides thread-safe operations without using locks. It uses atomic pointers and compare-and-swap operations for synchronization. Note: Some operations like size() may not be perfectly consistent in highly concurrent scenarios but will be eventually consistent.