diff options
author | Chris Robinson <[email protected]> | 2018-11-17 02:41:21 -0800 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2018-11-17 02:41:21 -0800 |
commit | 09943683b5872943cd1f9211ef2a77922906b906 (patch) | |
tree | f9cd5772aa2da5256e542bd1142aa743fa03bb30 /common | |
parent | b485cbe53a4bd5c3aab1b584c1752be8bc5cb894 (diff) |
Remove some more unused stuff
Diffstat (limited to 'common')
-rw-r--r-- | common/threads.c | 18 | ||||
-rw-r--r-- | common/threads.h | 18 |
2 files changed, 4 insertions, 32 deletions
diff --git a/common/threads.c b/common/threads.c index 1ecec365..b0f90bc5 100644 --- a/common/threads.c +++ b/common/threads.c @@ -213,17 +213,6 @@ int alsem_trywait(alsem_t *sem) } -void alcall_once(alonce_flag *once, void (*callback)(void)) -{ - LONG ret; - while((ret=InterlockedExchange(once, 1)) == 1) - althrd_yield(); - if(ret == 0) - (*callback)(); - InterlockedExchange(once, 2); -} - - void althrd_deinit(void) { ResetUIntMap(&ThrdIdHandle); @@ -239,10 +228,6 @@ void althrd_deinit(void) #endif -extern inline void alcall_once(alonce_flag *once, void (*callback)(void)); - -extern inline void althrd_deinit(void); - void althrd_setname(althrd_t thr, const char *name) { #if defined(HAVE_PTHREAD_SETNAME_NP) @@ -457,4 +442,7 @@ int alsem_trywait(alsem_t *sem) #endif /* __APPLE__ */ +void althrd_deinit(void) +{ } + #endif diff --git a/common/threads.h b/common/threads.h index ae033931..9abb22f2 100644 --- a/common/threads.h +++ b/common/threads.h @@ -37,15 +37,10 @@ typedef int (*althrd_start_t)(void*); #define WIN32_LEAN_AND_MEAN #include <windows.h> - typedef DWORD althrd_t; typedef CRITICAL_SECTION almtx_t; typedef HANDLE alsem_t; -typedef LONG alonce_flag; - -#define AL_ONCE_FLAG_INIT 0 -void alcall_once(alonce_flag *once, void (*callback)(void)); void althrd_deinit(void); @@ -90,7 +85,6 @@ inline int almtx_unlock(almtx_t *mtx) #include <semaphore.h> #endif /* __APPLE__ */ - typedef pthread_t althrd_t; typedef pthread_mutex_t almtx_t; #ifdef __APPLE__ @@ -98,10 +92,9 @@ typedef dispatch_semaphore_t alsem_t; #else /* !__APPLE__ */ typedef sem_t alsem_t; #endif /* __APPLE__ */ -typedef pthread_once_t alonce_flag; -#define AL_ONCE_FLAG_INIT PTHREAD_ONCE_INIT +void althrd_deinit(void); inline althrd_t althrd_current(void) { @@ -133,15 +126,6 @@ inline int almtx_unlock(almtx_t *mtx) return althrd_success; } - -inline void alcall_once(alonce_flag *once, void (*callback)(void)) -{ - pthread_once(once, callback); -} - - -inline void althrd_deinit(void) { } - #endif |