uvw 3.1.0
Loading...
Searching...
No Matches
Public Member Functions | List of all members
uvw::thread_local_storage Class Referencefinal

The thread local storage wrapper. More...

#include <thread.h>

Inheritance diagram for uvw::thread_local_storage:
Inheritance graph
[legend]
Collaboration diagram for uvw::thread_local_storage:
Collaboration graph
[legend]

Public Member Functions

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.
 
- Public Member Functions inherited from uvw::uv_type< uv_key_t >
virtual int init ()
 Initializes the handle.
 
loopparent () 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.
 

Detailed Description

The thread local storage 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 118 of file thread.h.

Member Function Documentation

◆ get()

template<typename T >
T * uvw::thread_local_storage::get ( )
inlinenoexcept

Gets the value of a given variable.

Template Parameters
TType to which to cast the opaque storage area.
Returns
A pointer to the given variable.

Definition at line 130 of file thread.h.

◆ set()

template<typename T >
void uvw::thread_local_storage::set ( T *  value)
inlinenoexcept

Sets the value of a given variable.

Template Parameters
TType of the variable to store aside.
Parameters
valueA valid pointer to the variable to store

Definition at line 140 of file thread.h.


The documentation for this class was generated from the following file: