BloombergLP::bslmt::ThreadUtil::getSpecific

Return the calling thread's value associated with the specified key.

Synopsis

Declared in <bslmt_threadutil.h>

static
void*
getSpecific(Key const& key);

Description

Return the thread-local value associated with the specified key. A key is shared among all threads and the value associated with key for each thread is 0 until it is set by that thread using setSpecific. The behavior is undefined unless this method is called outside any thread key cleanup function associated with any key by createKey, key was obtained from a successful call to createKey, and key has not been deleted.

Return Value

thread-local value associated with key for the calling thread

Parameters

NameDescription
keyprocess-wide thread-local key to query