TutTsdGetValue get the value of a thread-specific data key
key
a key created by TutTsdKeyCreate
value_return
location of a T_PTR into which the associated value is stored
TRUE
if key
exists and is set to a non-NULL
value, FALSE
otherwise.
If TutTsdGetValue fails, it returns FALSE
and sets the global SmartSockets error number to one of:
TutTsdGetValue gets the value associated with a thread-specific data key.
A FALSE
result is not necessarily an error it may just be that the value of the TSD key requested is NULL
. This is intended as a convenience for initializing TSD values.
TutTsdKeyCreate, TutTsdSetValue
This example retrieves a two-element integer array associated with a TSD key. If the key’s value has not been initialized, it is set.
T_TSD_KEY my_array_key;/* created previously */
T_INT4 *my_array; . . . if (!TutTsdGetValue(my_array_key, &my_array)) { my_array = (T_INT4 *)TutMalloc(sizeof(T_INT4) * 2); if (!TutTsdSetValue(my_array_key, my_array)) {/* error */
} }
TIBCO SmartSockets™ Utilities Software Release 6.8, July 2006 Copyright © TIBCO Software Inc. All rights reserved www.tibco.com |