diff options
Diffstat (limited to 'src/util/thread')
| -rw-r--r-- | src/util/thread/thread.h | 9 | ||||
| -rw-r--r-- | src/util/thread/thread_linux.c | 2 | ||||
| -rw-r--r-- | src/util/thread/thread_windows.c | 2 |
3 files changed, 7 insertions, 6 deletions
diff --git a/src/util/thread/thread.h b/src/util/thread/thread.h index 0c5042e..5975c84 100644 --- a/src/util/thread/thread.h +++ b/src/util/thread/thread.h @@ -8,16 +8,11 @@ #include "../../winwrap.h" #endif -#ifndef _WIN32 +#ifdef AKIYO_HAS_THREAD_CANCEL enum { AKI_THREAD_CANCEL_DEFERRED = PTHREAD_CANCEL_DEFERRED, AKI_THREAD_CANCEL_ASYNCHRONOUS = PTHREAD_CANCEL_ASYNCHRONOUS }; -#else -enum { - AKI_THREAD_CANCEL_DEFERRED = 0, - AKI_THREAD_CANCEL_ASYNCHRONOUS -}; #endif struct aki_thread { @@ -63,8 +58,10 @@ void aki_thread_sleep(aki_os_tstamp delay); void aki_thread_create(struct aki_thread *thread, aki_thread_func func, void *userdata); void aki_thread_join(struct aki_thread *thread); +#ifdef AKIYO_HAS_THREAD_CANCEL void aki_thread_cancel(struct aki_thread *thread); void aki_thread_setcanceltype(s32 type); +#endif //void aki_thread_detach(struct aki_thread *thread); void aki_mutex_init(struct aki_mutex *mutex); diff --git a/src/util/thread/thread_linux.c b/src/util/thread/thread_linux.c index 04b0868..26c3e18 100644 --- a/src/util/thread/thread_linux.c +++ b/src/util/thread/thread_linux.c @@ -22,6 +22,7 @@ void aki_thread_join(struct aki_thread *thread) pthread_join(thread->thread, NULL); } +#ifdef AKIYO_HAS_THREAD_CANCEL void aki_thread_cancel(struct aki_thread *thread) { pthread_cancel(thread->thread); @@ -31,6 +32,7 @@ void aki_thread_setcanceltype(s32 type) { pthread_setcanceltype(type, NULL); } +#endif /* void aki_thread_detach(struct aki_thread *thread) diff --git a/src/util/thread/thread_windows.c b/src/util/thread/thread_windows.c index b7bc0ec..c7fdd62 100644 --- a/src/util/thread/thread_windows.c +++ b/src/util/thread/thread_windows.c @@ -18,6 +18,7 @@ void aki_thread_join(struct aki_thread *thread) CloseHandle(thread->thread); } +#ifdef AKIYO_HAS_THREAD_CANCEL void aki_thread_cancel(struct aki_thread *thread) { (void)thread; @@ -27,6 +28,7 @@ void aki_thread_setcanceltype(s32 type) { (void)type; } +#endif /* void aki_thread_detach(struct aki_thread *thread) |