The ThreadLocalStorage wrapper.
More...
#include <thread.h>
|
template<typename T > |
T * | get () noexcept |
| Gets the value of a given variable.
|
|
template<typename T > |
void | set (T *value) noexcept |
| Sets the value of a given variable.
|
|
Loop & | loop () const noexcept |
| Gets the loop from which the resource was originated.
|
|
const uv_key_t * | raw () const noexcept |
| Gets the underlying raw data structure.
|
|
uv_key_t * | raw () noexcept |
| Gets the underlying raw data structure.
|
|
The ThreadLocalStorage wrapper.
A storage area that can only be accessed by one thread. The variable can be seen as a global variable that is only visible to a particular thread and not the whole program.
Definition at line 110 of file thread.h.
◆ get()
template<typename T >
T * uvw::ThreadLocalStorage::get |
( |
| ) |
|
|
inlinenoexcept |
Gets the value of a given variable.
- Template Parameters
-
T | Type to which to cast the opaque storage area. |
- Returns
- A pointer to the given variable.
Definition at line 122 of file thread.h.
◆ set()
template<typename T >
void uvw::ThreadLocalStorage::set |
( |
T * | value | ) |
|
|
inlinenoexcept |
Sets the value of a given variable.
- Template Parameters
-
T | Type of the variable to store aside. |
- Parameters
-
value | A valid pointer to the variable to store |
Definition at line 132 of file thread.h.
The documentation for this class was generated from the following file: