BloombergLP::bslmt::ThreadUtil::setSpecific

Associate the specified thread-local value with the specified process-wide key. Return 0 on success, and a non-zero value otherwise. The value associated with a thread for a given key is 0 until it has been 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.

Synopsis

Declared in <bslmt_threadutil.h>

static
int
setSpecific(
    Key const& key,
    void const* value);