Local storage for threadsLocal thread storage enables multiple threads to use the same ID to store and retrieve an object that is local to the thread. More...
#include <fthread.h>
Public Member Functions | |
| ~FLocalThreadStorage () | |
| Destructor. | |
| bool | setData (FUnknown *data) |
| Store an object into the current thread context. | |
| FUnknown * | getData () const |
| Retrieve data from the current thread context. | |
Static Public Member Functions | |
| static FLocalThreadStorage * | create () |
| Create a new local storage object. | |
Local storage for threads
Local thread storage enables multiple threads to use the same ID to store and retrieve an object that is local to the thread.
| ~FLocalThreadStorage | ( | ) |
Destructor.
| FLocalThreadStorage * create | ( | ) | [static] |
Create a new local storage object.
Remarks: There's a race condition on Windows if a FLocalThreadStorage is deleted while a Thread is still running and has set a data object, this object is not released.
| bool setData | ( | FUnknown * | data | ) |
Store an object into the current thread context.
The data object is shared while the thread lives or a new object is set.
| data | object |
| FUnknown * getData | ( | ) | const |
Retrieve data from the current thread context.