/home/travis/build/MoarVM/MoarVM/src/platform/threads.h
Line | Count | Source |
1 | | #if defined _WIN32 |
2 | | #define MVM_platform_thread_yield SwitchToThread |
3 | | #elif defined MVM_HAS_PTHREAD_YIELD |
4 | | #include <pthread.h> |
5 | | #define MVM_platform_thread_yield pthread_yield |
6 | | #else |
7 | | #include <sched.h> |
8 | 2.68k | #define MVM_platform_thread_yield sched_yield |
9 | | #endif |
10 | | |
11 | | #if defined _WIN32 |
12 | | #define MVM_platform_thread_exit(status) ExitThread(0) |
13 | | #define MVM_platform_thread_id() (MVMint64)GetCurrentThreadId() |
14 | | #else |
15 | 173 | #define MVM_platform_thread_exit(status) pthread_exit(status) |
16 | 317 | #define MVM_platform_thread_id() (MVMint64)uv_thread_self() |
17 | | #endif |