This is the reference documentation of namespace threads of the ALib C++ Library, which holds types of library module ALib Threads.
Further documentation is provided with
Nested Namespaces: | |
namespace | detail |
Details of namespace alib::threads. | |
Type Index: | |
class | Condition |
struct | DbgConditionAsserter |
struct | DbgLockAsserter |
struct | DbgSharedLockAsserter |
class | Lock |
class | Promise |
class | RecursiveLock |
class | RecursiveTimedLock |
class | Runnable |
class | SharedLock |
class | SharedTimedLock |
struct | TCondition |
class | Thread |
class | TimedLock |
Type Definition Index: | |
using | ThreadID = integer |
The ALib thread identifier type. | |
Function Index: | |
void | bootstrap () |
void | BootstrapThreadMap (integer qty) |
void | shutdown () |
Variable Index: | |
ALIB_DLL Lock | STD_IOSTREAMS_LOCK |
thread_local Thread * | THIS_THREAD = nullptr |
A thread-local pointer to the ALib representation of the actual thread. | |
constexpr ThreadID | UNDEFINED = 0 |
This is a value that may be passed as a value indicating an undefined thread. | |
using alib::threads::ThreadID = integer |
The ALib thread identifier type.
Definition at line 23 of file thread.inl.
ALIB_DLL void alib::threads::bootstrap | ( | ) |
Initializes ALib thread logic. Multiple invocations of this method are forbidden.
The standard bootstrap code of ALib, hence the (overloaded) functions alib::Bootstrap will call this function.
Definition at line 138 of file thread.cpp.
Internally, a hash map used to find the current thread object. The map uses default values for HashTable::BaseLoadFactor and HashTable::MaxLoadFactor. Depending on the use of threads by a using application, these values might be modified before starting the first phase of bootstrapping ALib.
This namespace function allows doing this by passing the given parameters to method HashTable::Reserve of the internal table.
std::unordered_map
, which receives similar parameters.qty | The expected number of threads. |
Definition at line 131 of file thread.cpp.
ALIB_DLL void alib::threads::shutdown | ( | ) |
Frees resources and shuts down ALib thread logic. Multiple invocations of this method are forbidden. The standard bootstrap code of ALib, hence the (overloaded) functions alib::Shutdown will call this function.
Definition at line 161 of file thread.cpp.
Lock alib::threads::STD_IOSTREAMS_LOCK |
This global mutex is acquired by ALib-types, whenever data is written to either std::cout
or std::cerr
. This is, for example, acquired by function alib::assert::Raise and by loggers of module ALox that log to the console.
thread_local Thread * alib::threads::THIS_THREAD = nullptr |
A thread-local pointer to the ALib representation of the actual thread.
Definition at line 219 of file thread.cpp.
|
inlineconstexpr |
This is a value that may be passed as a value indicating an undefined thread.
Definition at line 29 of file thread.inl.