[前][次][番号順一覧][スレッド一覧]

ruby-changes:52195

From: normal <ko1@a...>
Date: Fri, 17 Aug 2018 11:07:00 +0900 (JST)
Subject: [ruby-changes:52195] normal:r64403 (trunk): thread_pthread.c (rb_sigwait_fd_get): skip getpid check

normal	2018-08-17 11:06:54 +0900 (Fri, 17 Aug 2018)

  New Revision: 64403

  https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=64403

  Log:
    thread_pthread.c (rb_sigwait_fd_get): skip getpid check
    
    This is not called in signal handlers, so there's no reason for
    it.  glibc 2.25+ no longer caches getpid(), so it will cost a
    syscall for those users.

  Modified files:
    trunk/thread_pthread.c
Index: thread_pthread.c
===================================================================
--- thread_pthread.c	(revision 64402)
+++ thread_pthread.c	(revision 64403)
@@ -1866,11 +1866,8 @@ rb_sleep_cond_put(rb_nativethread_cond_t https://github.com/ruby/ruby/blob/trunk/thread_pthread.c#L1866
 int
 rb_sigwait_fd_get(const rb_thread_t *th)
 {
-    rb_pid_t current = getpid();
-
-    if (signal_self_pipe.owner_process == current &&
-        signal_self_pipe.normal[0] >= 0) {
-
+    if (signal_self_pipe.normal[0] >= 0) {
+        VM_ASSERT(signal_self_pipe.owner_process == getpid());
         /*
          * no need to keep firing the timer if any thread is sleeping
          * on the signal self-pipe

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]