Base Module  VST 3.6.6
SDK for developing VST Plug-in
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Public Member Functions | Static Public Member Functions
FLocalThreadStorage Class Reference

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. More...
 
bool setData (FUnknown *data)
 Store an object into the current thread context. More...
 
FUnknown * getData () const
 Retrieve data from the current thread context. More...
 

Static Public Member Functions

static void initStates ()
 Initiatlize FLocalThreadStorage states (optional) More...
 
static FLocalThreadStoragecreate ()
 Create a new local storage object. More...
 

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

void initStates ( )
static

Initiatlize FLocalThreadStorage states (optional)

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

Remarks: This method is available for static's destruction ordering is necessary and the automatic init from creates() is too late.

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
dataobject
Returns
true on success else false
FUnknown * getData ( ) const

Retrieve data from the current thread context.

Returns
data object
Empty

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