diff options
author | mame <mame@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2018-08-03 05:11:20 +0000 |
---|---|---|
committer | mame <mame@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2018-08-03 05:11:20 +0000 |
commit | 4cef2c8d6b61cc517191da781f777306823a05cb (patch) | |
tree | e3876414549b4b184e76abf5e8aefab5e1c8552b /thread_pthread.c | |
parent | 8c2ae6e3ed072b06fc3cbc34fa8a14b2acbb49d5 (diff) | |
download | ruby-4cef2c8d6b61cc517191da781f777306823a05cb.tar.gz |
thread_pthread.c: add a macro guard for PTHREAD_CANCEL_ENABLE
It seems to be unavailable on some platforms including my Android phone.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64166 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'thread_pthread.c')
-rw-r--r-- | thread_pthread.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/thread_pthread.c b/thread_pthread.c index b095c2ef1c..39b8e79f49 100644 --- a/thread_pthread.c +++ b/thread_pthread.c @@ -1551,9 +1551,11 @@ mjit_worker(void *arg) { void (*worker_func)(void) = (void(*)(void))arg; +#ifdef PTHREAD_CANCEL_ENABLE if (pthread_setcancelstate(PTHREAD_CANCEL_ENABLE, NULL) != 0) { fprintf(stderr, "Cannot enable cancellation in MJIT worker\n"); } +#endif #ifdef SET_CURRENT_THREAD_NAME SET_CURRENT_THREAD_NAME("ruby-mjitworker"); /* 16 byte including NUL */ #endif |