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

ruby-changes:8695

From: nobu <ko1@a...>
Date: Thu, 13 Nov 2008 11:31:35 +0900 (JST)
Subject: [ruby-changes:8695] Ruby:r20230 (trunk): * thread.c (rb_barrier_wait): gets rid of recursive deadlock.

nobu	2008-11-13 11:31:16 +0900 (Thu, 13 Nov 2008)

  New Revision: 20230

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=20230

  Log:
    * thread.c (rb_barrier_wait): gets rid of recursive deadlock.

  Modified files:
    trunk/ChangeLog
    trunk/thread.c

Index: ChangeLog
===================================================================
--- ChangeLog	(revision 20229)
+++ ChangeLog	(revision 20230)
@@ -1,3 +1,7 @@
+Thu Nov 13 11:31:13 2008  Nobuyoshi Nakada  <nobu@r...>
+
+	* thread.c (rb_barrier_wait): gets rid of recursive deadlock.
+
 Thu Nov 13 06:08:44 2008  Nobuyoshi Nakada  <nobu@r...>
 
 	* thread.c (rb_barrier_{new,wait,release,destroy}): use Mutex so that
Index: thread.c
===================================================================
--- thread.c	(revision 20229)
+++ thread.c	(revision 20230)
@@ -3050,8 +3050,11 @@
 rb_barrier_wait(VALUE self)
 {
     VALUE mutex = (VALUE)DATA_PTR(self);
+    mutex_t *m;
 
     if (!mutex) return Qfalse;
+    GetMutexPtr(mutex, m);
+    if (m->th == GET_THREAD()) return Qfalse;
     rb_mutex_lock(mutex);
     if (DATA_PTR(self)) return Qtrue;
     rb_mutex_unlock(mutex);

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

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