* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: thread.h,v 1.16 2004/03/05 05:12:06 marka Exp $ */
+/* $Id: thread.h,v 1.16.18.1 2005/09/09 12:31:53 marka Exp $ */
#ifndef ISC_THREAD_H
#define ISC_THREAD_H 1
typedef unsigned int isc_threadresult_t;
typedef void * isc_threadarg_t;
typedef isc_threadresult_t (WINAPI *isc_threadfunc_t)(isc_threadarg_t);
+typedef DWORD isc_thread_key_t;\r
#define isc_thread_self (unsigned long)GetCurrentThreadId
void
isc_thread_setconcurrency(unsigned int level);
+int\r
+isc_key_create(isc_thread_key_t *key, void (*func)(void *));\r
+\r
+int\r
+isc_key_destroy(isc_thread_key_t key);\r
+\r
+void *\r
+isc_key_getspecific(isc_thread_key);\r
+\r
+int\r
+isc_key_setspecific(isc_thread_key_t key, void *value);\r
+\r
ISC_LANG_ENDDECLS
#endif /* ISC_THREAD_H */
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: thread.c,v 1.18 2004/03/05 05:11:59 marka Exp $ */
+/* $Id: thread.c,v 1.18.18.1 2005/09/09 12:31:53 marka Exp $ */
#include <config.h>
* call exists
*/
}
+\r
+void *\r
+isc_key_getspecific(isc_thread_key_t key) {\r
+ return(TlsGetValue(key));\r
+}\r
+\r
+int\r
+isc_key_setspecific(isc_thread_key_t key, void *value) {\r
+ return (TlsSetValue(key, value) ? 0 : GetLastError());\r
+}\r
+\r
+int\r
+isc_key_create(isc_thread_key_t *key, void (*func)(void *)) {\r
+ *key = TlsAlloc();\r
+\r
+ return ((*key == -1) ? 0 : GetLastError());\r
+}\r
+\r
+int\r
+isc_key_destroy(isc_thread_key_t key) {\r
+ return (TlsFree(key) ? 0 : GetLastError());\r
+}\r
+
\ No newline at end of file