view src/platform/threads.h @ 4:352169b06523

update
author Takahiro SHIMIZU <anatofuz@cr.ie.u-ryukyu.ac.jp>
date Fri, 05 Oct 2018 19:31:02 +0900 (2018-10-05)
parents 2cf249471370
children
line wrap: on
line source
#if defined _WIN32
#define MVM_platform_thread_yield SwitchToThread
#elif defined MVM_HAS_PTHREAD_YIELD
#include <pthread.h>
#define MVM_platform_thread_yield pthread_yield
#else
#include <sched.h>
#define MVM_platform_thread_yield sched_yield
#endif

#if defined _WIN32
#define MVM_platform_thread_exit(status) ExitThread(0)
#define MVM_platform_thread_id() (MVMint64)GetCurrentThreadId()
#else
#define MVM_platform_thread_exit(status) pthread_exit(status)
#define MVM_platform_thread_id() (MVMint64)uv_thread_self()
#endif