Class for handling thread local storage.
More...
#include "nn/nlib/threading/Tls.h"
|
constexpr | Tls () noexcept |
| Instantiates the object with default parameters (default constructor).
|
|
errno_t | Init () noexcept |
| Initializes thread local storage. More...
|
|
| ~Tls () noexcept |
| Destructor. The pointer will be delete d.
|
|
T * | Get () const noexcept |
| Gets a pointer to the specified thread. More...
|
|
T * | operator-> () const noexcept |
| Returns the pointer.
|
|
T & | operator* () const noexcept |
| Dereferences the pointer.
|
|
T * | Release () noexcept |
| Releases the pointer to the specified thread. More...
|
|
errno_t | Reset (T *p=0) noexcept |
| Releases the pointer to the specified thread. More...
|
|
template<class T>
class nn::nlib::threading::Tls< T >
Class for handling thread local storage.
- Template Parameters
-
T | Type of object storing the pointer. |
- Description
- This class wraps
nlib_tls
.
Definition at line 26 of file Tls.h.
◆ Get()
Gets a pointer to the specified thread.
- Returns
- Pointer to the object of type
T
.
Definition at line 57 of file Tls.h.
◆ Init()
Initializes thread local storage.
- Return values
-
0 | Initialization was successful. |
ENOMEM | Indicates that there are not enough system resources. |
- Description
- Run once before using thread local storage.
Definition at line 30 of file Tls.h.
◆ Release()
Releases the pointer to the specified thread.
- Returns
- Pointer to the object of type
T
.
- Description
- The pointer will no longer be controlled by
Tls
after running the function.
Definition at line 65 of file Tls.h.
◆ Reset()
Releases the pointer to the specified thread.
- Parameters
-
[in] | p | Pointer to the object allocated by new . |
- Return values
-
0 | Initialization was successful. |
ENOMEM | Indicates that there are not enough system resources. |
- Description
- The pointer held by
Tls
is delete
d, and p is replaced.
Definition at line 70 of file Tls.h.
The documentation for this class was generated from the following files: