36#ifndef _UTILS_LINKEDOBJECT_HXX_
37#define _UTILS_LINKEDOBJECT_HXX_
59 if (isInitialized_.exchange(1) == 0)
63 return &atomic_.
value();
67 std::atomic_uint_least8_t isInitialized_;
90 return static_cast<T *
>(
link_);
96 return static_cast<T *
>(
head_);
108 return static_cast<T *
>(
this);
124 while (*p && *p !=
this)
126 p = &((*p)->LinkedObject<T>
::link_);
See OSMutexLock in os/OS.hxx.
Lightweight locking class for protecting small critical sections.
This object encapsulates an Atomic, which never gets destroyed.
This static object is factored into a separate namespace because current GDB crashes when trying to p...
Using this class as a base class will cause the given class to have all its instances linked up in a ...
T * link_
Linked list pointer.
LinkedObject()
Constructor. Puts *this on the linked list.
static Atomic * head_mu()
Locks the list for modification (at any entry!).
~LinkedObject()
Constructor. Removes *this from the linked list.
static T * head_
Beginning of the list.
Template class that allows allocating storage for an object but not calling its constructor.
T & emplace(Args &&... args)
Constructs the embedded object.
#define HASSERT(x)
Checks that the value of expression x is true, else terminates the current process.