aboutsummaryrefslogtreecommitdiffstats
path: root/process.c
diff options
context:
space:
mode:
authornormal <normal@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-09-19 08:23:19 +0000
committernormal <normal@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-09-19 08:23:19 +0000
commit41cf596dfd5a1f77c89a3b77417a0d47b7cd00ce (patch)
treed87cb1f771d72501c1cbeca20d017dbf9ccbf126 /process.c
parentf0f13cff722c51e6a9d3a198c5e673c9923e48ac (diff)
downloadruby-41cf596dfd5a1f77c89a3b77417a0d47b7cd00ce.tar.gz
process.c (waitpid_cleanup): unconditionally remove from waiters
This is the safer option, as there seems to be cases where checking waitpid_state.ret is insufficient in ensure. I'm not 100% sure why this is, but this change was required for my work-in-progress Thread::Light patch series, too... git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64782 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'process.c')
-rw-r--r--process.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/process.c b/process.c
index 94060de148..1ca7847df2 100644
--- a/process.c
+++ b/process.c
@@ -1106,7 +1106,11 @@ waitpid_cleanup(VALUE x)
{
struct waitpid_state *w = (struct waitpid_state *)x;
- if (w->ret == 0) {
+ /*
+ * XXX w->ret is sometimes set but list_del is still needed, here,
+ * Not sure why, so we unconditionally do list_del here:
+ */
+ if (TRUE || w->ret == 0) {
rb_vm_t *vm = rb_ec_vm_ptr(w->ec);
rb_native_mutex_lock(&vm->waitpid_lock);