aboutsummaryrefslogtreecommitdiffstats
path: root/thread_pthread.c
diff options
context:
space:
mode:
authornormal <normal@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-12-08 20:36:32 +0000
committernormal <normal@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-12-08 20:36:32 +0000
commit1a17766e6ab19181d7a471e4271eadf6eb42f33a (patch)
treeba6b81bf3a8e7393941fd14b5ea7864653c722fd /thread_pthread.c
parent2b1dcc1dd1eb260fd20ff1e6e0dfb0e5624a3cc6 (diff)
downloadruby-1a17766e6ab19181d7a471e4271eadf6eb42f33a.tar.gz
Revert "thread_pthread.c: fix memory leak from fork loop leapfrog"
Oops, CI failures... This reverts r66288 / commit 2b1dcc1dd1eb260fd20ff1e6e0dfb0e5624a3cc6. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66289 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'thread_pthread.c')
-rw-r--r--thread_pthread.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/thread_pthread.c b/thread_pthread.c
index 18624f42c9..c87e952750 100644
--- a/thread_pthread.c
+++ b/thread_pthread.c
@@ -1726,12 +1726,16 @@ rb_thread_create_timer_thread(void)
if (setup_communication_pipe_internal(signal_self_pipe.normal) < 0) return;
if (setup_communication_pipe_internal(signal_self_pipe.ub_main) < 0) return;
- ubf_timer_create(current);
if (owner != current) {
/* validate pipe on this process */
+ ubf_timer_create(current);
sigwait_th = THREAD_INVALID;
signal_self_pipe.owner_process = current;
}
+ else if (UBF_TIMER == UBF_TIMER_PTHREAD) {
+ /* UBF_TIMER_PTHREAD needs to recreate after fork */
+ ubf_timer_pthread_create(current);
+ }
}
static void
@@ -1759,13 +1763,7 @@ ubf_timer_disarm(void)
static void
ubf_timer_destroy(void)
{
-#if UBF_TIMER == UBF_TIMER_POSIX
- if (timer_posix.owner == getpid()) {
- if (timer_delete(timer_posix.timerid) < 0)
- rb_sys_fail("timer_delete");
- memset(&timer_posix, 0, sizeof(timer_posix));
- }
-#elif UBF_TIMER == UBF_TIMER_PTHREAD
+#if UBF_TIMER == UBF_TIMER_PTHREAD
int err;
timer_pthread.owner = 0;
@@ -1776,6 +1774,7 @@ ubf_timer_destroy(void)
rb_raise(rb_eThreadError, "native_thread_join() failed (%d)", err);
}
#endif
+/* no need to destroy real POSIX timers */
}
static int