mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
thread_pthread: stop trying to deal with cancellation
We don't use pthreads cancellation ourselves and it's painful to use correctly. Any cancelled threads would break vm->living_threads, GVL, thread_sync.c, autoload, etc... So don't bother caring; because we can't stop rogue extensions from completely breaking the VM in other ways, either. [ruby-core:88282] [Misc #14962] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64197 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
e09c14a05f
commit
2ba640f359
2 changed files with 0 additions and 20 deletions
15
process.c
15
process.c
|
@ -3869,7 +3869,6 @@ has_privilege(void)
|
||||||
struct child_handler_disabler_state
|
struct child_handler_disabler_state
|
||||||
{
|
{
|
||||||
sigset_t sigmask;
|
sigset_t sigmask;
|
||||||
int cancelstate;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -3890,13 +3889,6 @@ disable_child_handler_before_fork(struct child_handler_disabler_state *old)
|
||||||
#else
|
#else
|
||||||
# pragma GCC warning "pthread_sigmask on fork is not available. potentially dangerous"
|
# pragma GCC warning "pthread_sigmask on fork is not available. potentially dangerous"
|
||||||
#endif
|
#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
|
static void
|
||||||
|
@ -3904,13 +3896,6 @@ disable_child_handler_fork_parent(struct child_handler_disabler_state *old)
|
||||||
{
|
{
|
||||||
int ret;
|
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
|
#ifdef HAVE_PTHREAD_SIGMASK
|
||||||
ret = pthread_sigmask(SIG_SETMASK, &old->sigmask, NULL); /* not async-signal-safe */
|
ret = pthread_sigmask(SIG_SETMASK, &old->sigmask, NULL); /* not async-signal-safe */
|
||||||
if (ret != 0) {
|
if (ret != 0) {
|
||||||
|
|
|
@ -1551,11 +1551,6 @@ mjit_worker(void *arg)
|
||||||
{
|
{
|
||||||
void (*worker_func)(void) = (void(*)(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
|
#ifdef SET_CURRENT_THREAD_NAME
|
||||||
SET_CURRENT_THREAD_NAME("ruby-mjitworker"); /* 16 byte including NUL */
|
SET_CURRENT_THREAD_NAME("ruby-mjitworker"); /* 16 byte including NUL */
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue