TutTsdSetValue set the value of a thread-specific data key
key
a key created by TutTsdKeyCreate
value
a T_PTR value to be associated with key
in the current thread
TRUE
if the association is successful, FALSE
otherwise.
If TutTsdSetValue fails, it returns FALSE
and sets the global SmartSockets error number to one of:
TutTsdSetValue sets the value associated with a thread-specific data key.
None
TutTsdGetValue, TutTsdKeyCreate
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 |