The ThreadLocalStorage wrapper.
More...
#include <thread.h>
|
| template<typename T > |
| T * | get () noexcept |
| | Gets the value of a given variable. More...
|
| |
| template<typename T > |
| void | set (T *value) noexcept |
| | Sets the value of a given variable. More...
|
| |
| Loop & | loop () const noexcept |
| | Gets the loop from which the resource was originated. More...
|
| |
| const uv_key_t * | raw () const noexcept |
| | Gets the underlying raw data structure. More...
|
| |
| uv_key_t * | raw () noexcept |
| | Gets the underlying raw data structure. More...
|
| |
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 117 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 129 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 139 of file thread.h.
The documentation for this class was generated from the following file: