16 #ifndef INCLUDE_NN_NLIB_THREADING_TLS_H_ 17 #define INCLUDE_NN_NLIB_THREADING_TLS_H_ 29 if (is_idx_valid_)
return EALREADY;
31 if (e == 0) is_idx_valid_ =
true;
37 is_idx_valid_ =
false;
43 if (e != 0)
return NULL;
44 return reinterpret_cast<T*
>(p);
63 delete reinterpret_cast<T*
>(p);
72 #endif // INCLUDE_NN_NLIB_THREADING_TLS_H_ errno_t Reset(T *p=0) noexcept
Releases the pointer to the specified thread.
T & operator*() const noexcept
Dereferences the pointer.
T * Release() noexcept
Releases the pointer to the specified thread.
T * operator->() const noexcept
Returns the pointer.
T * Get() const noexcept
Gets a pointer to the specified thread.
errno_t Init() noexcept
Initializes thread local storage.
Class for handling thread local storage.
constexpr Tls() noexcept
Instantiates the object with default parameters (default constructor).
#define NLIB_NOEXCEPT
Defines noexcept geared to the environment, or the equivalent.
#define NLIB_CEXPR
Defines constexpr if it is available for use. If not, holds an empty string.
~Tls() noexcept
Destructor. The pointer will be deleted.
A file that contains the configuration information for each development environment.
#define NLIB_FINAL
Defines final if it is available for use. If not, holds an empty string.