libcosmos
Linux C++ System Programming Library
|
#include <cosmos/dso_export.h>
#include <cosmos/proc/types.hxx>
#include <cosmos/utils.hxx>
Go to the source code of this file.
Enumerations | |
enum class | ThreadID : pid_t { SELF = 0 } |
Functions | |
ProcessID | cosmos::as_pid (const ThreadID id) |
Return the ProcessID representation of the given thread ID. | |
ThreadID | cosmos::thread::get_tid () |
Returns the Linux low-level thread ID of the caller. | |
bool | cosmos::thread::is_main_thread () |
Returns whether the calling thread is this process's main thread. | |
This header contains low level Linux thread functionality (i.e. not pthread related).
Definition in file thread.hxx.
|
strong |
Definition at line 17 of file thread.hxx.
|
inline |
Return the ProcessID representation of the given thread ID.
Thread IDs are treated very similar to process IDs on Linux. For extra type safety and for being explicit libcosmos uses a strong unique type ThreadID, which can be explicitly casted into a ProcessID, if required.
Definition at line 27 of file thread.hxx.
ThreadID COSMOS_API cosmos::thread::get_tid | ( | ) |
Returns the Linux low-level thread ID of the caller.
Definition at line 11 of file thread.cxx.
bool COSMOS_API cosmos::thread::is_main_thread | ( | ) |
Returns whether the calling thread is this process's main thread.
Definition at line 16 of file thread.cxx.