FLocalThreadStorage Class Reference
[Thread Handling]

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 FLocalThreadStoragecreate ()
 Create a new local storage object.

Detailed Description

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.


Constructor & Destructor Documentation

Destructor.


Member Function Documentation

FLocalThreadStorage * create (  )  [static]

Create a new local storage object.

Returns:
new local storage object. Caller needs to delete it when done.

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.

Parameters:
data object
Returns:
true on success else false
FUnknown * getData (  )  const

Retrieve data from the current thread context.

Returns:
data object
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Defines
Empty

Copyright ©2013 Steinberg Media Technologies GmbH. All Rights Reserved.