typedef void * isc_threadresult_t;
typedef void * isc_threadarg_t;
typedef isc_threadresult_t (*isc_threadfunc_t)(isc_threadarg_t);
-typedef pthread_key_t isc_thread_key_t;
void
isc_thread_create(isc_threadfunc_t, isc_threadarg_t, isc_thread_t *);
#define isc_thread_self \
(unsigned long)pthread_self
-#define isc_thread_key_create pthread_key_create
-#define isc_thread_key_getspecific pthread_getspecific
-#define isc_thread_key_setspecific pthread_setspecific
-#define isc_thread_key_delete pthread_key_delete
-
/***
*** Thread-Local Storage
***/
typedef DWORD 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;
#define isc_thread_self (unsigned long)GetCurrentThreadId
isc_result_t
isc_thread_setaffinity(int cpu);
-int
-isc_thread_key_create(isc_thread_key_t *key, void (*func)(void *));
-
-int
-isc_thread_key_delete(isc_thread_key_t key);
-
-void *
-isc_thread_key_getspecific(isc_thread_key_t);
-
-int
-isc_thread_key_setspecific(isc_thread_key_t key, void *value);
-
#define isc_thread_yield() Sleep(0)
#if HAVE___DECLSPEC_THREAD
isc_taskpool_size
isc_thread_create
isc_thread_join
-isc_thread_key_create
-isc_thread_key_delete
-isc_thread_key_getspecific
-isc_thread_key_setspecific
isc_thread_setaffinity
isc_thread_setconcurrency
isc_thread_setname
/* no-op on Windows for now */
return (ISC_R_SUCCESS);
}
-
-void *
-isc_thread_key_getspecific(isc_thread_key_t key) {
- return(TlsGetValue(key));
-}
-
-int
-isc_thread_key_setspecific(isc_thread_key_t key, void *value) {
- return (TlsSetValue(key, value) ? 0 : GetLastError());
-}
-
-int
-isc_thread_key_create(isc_thread_key_t *key, void (*func)(void *)) {
- *key = TlsAlloc();
-
- return ((*key != -1) ? 0 : GetLastError());
-}
-
-int
-isc_thread_key_delete(isc_thread_key_t key) {
- return (TlsFree(key) ? 0 : GetLastError());
-}