Misc #14962 ยป 0001-thread_pthread-stop-trying-to-deal-with-cancellation.patch
| process.c | ||
|---|---|---|
|
struct child_handler_disabler_state
|
||
|
{
|
||
|
sigset_t sigmask;
|
||
|
int cancelstate;
|
||
|
};
|
||
|
static void
|
||
| ... | ... | |
|
#else
|
||
|
# pragma GCC warning "pthread_sigmask on fork is not available. potentially dangerous"
|
||
|
#endif
|
||
|
#ifdef PTHREAD_CANCEL_DISABLE
|
||
|
ret = pthread_setcancelstate(PTHREAD_CANCEL_DISABLE, &old->cancelstate);
|
||
|
if (ret != 0) {
|
||
|
rb_syserr_fail(ret, "pthread_setcancelstate");
|
||
|
}
|
||
|
#endif
|
||
|
}
|
||
|
static void
|
||
| ... | ... | |
|
{
|
||
|
int ret;
|
||
|
#ifdef PTHREAD_CANCEL_DISABLE
|
||
|
ret = pthread_setcancelstate(old->cancelstate, NULL);
|
||
|
if (ret != 0) {
|
||
|
rb_syserr_fail(ret, "pthread_setcancelstate");
|
||
|
}
|
||
|
#endif
|
||
|
#ifdef HAVE_PTHREAD_SIGMASK
|
||
|
ret = pthread_sigmask(SIG_SETMASK, &old->sigmask, NULL); /* not async-signal-safe */
|
||
|
if (ret != 0) {
|
||
| thread_pthread.c | ||
|---|---|---|
|
{
|
||
|
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
|
||
|
-
|
||