ALib C++ Library
Library Version: 2312 R0
Documentation generated by doxygen
Variables | Functions
aworx::lib::threads::detail Namespace Reference

Details of namespace aworx::lib::threads.

Variables

ALIB_API std::mutex moduleLock
 
ALIB_API HashMap< std::thread::id, Thread * > threadMap
 

Functions

ALIB_API ThreadgetThread (std::thread::id c11ID)
 
void threadStart (Thread *thread)
 

Function Documentation

◆ getThread()

ALIB_API Thread * getThread ( std::thread::id  c11ID)

Retrieves the ALib object associated with the given C++ 11 thread id. In case the threadID is not found in the hash table, the given id is considered a system thread and is entered into the hash table.

Parameters
c11IDThe native thread id.
Returns
The associated ALib thread object.

Definition at line 96 of file thread.cpp.

Here is the call graph for this function:

◆ threadStart()

void threadStart ( Thread thread)

Internal method to start a thread.

Parameters
threadThe ALib thread object to start.

Definition at line 89 of file thread.cpp.

Here is the call graph for this function:

Variable Documentation

◆ moduleLock

ALIB_API std::mutex moduleLock

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

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

◆ threadMap

ALIB_API HashMap<std::thread::id, Thread*> threadMap

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 prior to 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 Memory in the ALib Distribution, the type of this object is std::unordered_map.