Public Member Functions | |
void | deleteLocalObjects () |
Delete all local objects in the current thread. | |
ObjectPtr | getLocalObject (const UString &name) |
Get the value of a thread local object. More... | |
void | setLocalObject (const UString &name, const ObjectPtr &obj) |
Set the value of a thread local object. More... | |
Static Public Member Functions | |
static ThreadLocalObjects * | Instance () |
Get the instance of the singleton of this class. More... | |
Thread local objects.
System-agnostic interface to "thread local storage" (Windows) or "thread specific data" (POSIX thread). This class is a singleton which gives access to all local objects of the current thread.
When a thread terminates, all its local objects which were inserted using this singleton are deleted.
The actual time where these deletions occur depends on the thread and the operating system.
In other words, ThreadLocalObjects is really safe only on threads which were created by ts::Thread.
|
static |
Get the instance of the singleton of this class.
Set the value of a thread local object.
[in] | name | Name of the object. |
[in] | obj | A smart pointer to the object with that name in the current thread. |
Get the value of a thread local object.
[in] | name | Name of the object. |