ALib C++ Library
Library Version: 2412 R0
Documentation generated by doxygen
Loading...
Searching...
No Matches
alib::threads::detail Namespace Reference

Description:

Details of namespace alib::threads.

Function Index:

void threadStart (Thread *thread)
 

Variable Index:

ALIB_API std::mutex MODULE_LOCK
 
ALIB_API HashMap< MonoAllocator, std::thread::id, Thread * > THREAD_MAP
 Directory which assigns system thread IDs to ALib Thread objects.
 

Function Details:

◆ threadStart()

void threadStart ( Thread * thread)

Internal method to start a thread.

Parameters
threadThe ALib thread object to start.

Definition at line 73 of file thread.cpp.

Here is the call graph for this function:

Variable Details:

◆ MODULE_LOCK

ALIB_API std::mutex MODULE_LOCK
extern

The internal mutex used with operations like starting, ending or finding thread objects.

Note
With the presence of module ALib Monomem in the ALib Distribution, this object is not available. Instead, GLOBAL_ALLOCATOR_LOCK is used, because this likewise protects modifications on object detail::THREAD_MAP, which uses this allocator.

◆ THREAD_MAP

HashMap< MonoAllocator, std::thread::id, Thread * > THREAD_MAP

Directory which assigns system thread IDs to ALib Thread objects.

The hash map used to find the current thread object. The object 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.

If so, an initial call to HashTable::Reserve may be likewise be performed.

Note
With the absence of module ALib Monomem in the ALib Distribution, the type of this object is std::unordered_map.

Definition at line 62 of file thread.cpp.