mirror of
https://github.com/isc-projects/bind9.git
synced 2026-06-11 09:09:59 -04:00
Remove isc_thread_key API in favor of ISC_THREAD_LOCAL variables
For BIND 9.16+, TLS aware compiler is required, and using ISC_THREAD_LOCAL is preferred way of using Thread Local Storage. The isc_thread_key API is no longer used anywhere and hence was removed from BIND 9.
This commit is contained in:
parent
5d43b7126c
commit
b1a7ec7481
4 changed files with 0 additions and 45 deletions
|
|
@ -30,7 +30,6 @@ typedef pthread_t isc_thread_t;
|
|||
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 *);
|
||||
|
|
@ -53,11 +52,6 @@ isc_thread_setaffinity(int cpu);
|
|||
#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
|
||||
***/
|
||||
|
|
|
|||
|
|
@ -61,7 +61,6 @@ typedef HANDLE isc_thread_t;
|
|||
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
|
||||
|
||||
|
|
@ -82,18 +81,6 @@ isc_thread_setname(isc_thread_t, const char *);
|
|||
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
|
||||
|
|
|
|||
|
|
@ -651,10 +651,6 @@ isc_taskpool_setprivilege
|
|||
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
|
||||
|
|
|
|||
|
|
@ -73,25 +73,3 @@ isc_thread_setaffinity(int cpu) {
|
|||
/* 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());
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue