зеркало из https://github.com/github/ruby.git
* thread.c (rb_barrier_wait): gets rid of recursive deadlock.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20230 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
Родитель
31f16d7729
Коммит
5136031055
|
@ -1,3 +1,7 @@
|
|||
Thu Nov 13 11:31:13 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||
|
||||
* thread.c (rb_barrier_wait): gets rid of recursive deadlock.
|
||||
|
||||
Thu Nov 13 06:08:44 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||
|
||||
* thread.c (rb_barrier_{new,wait,release,destroy}): use Mutex so that
|
||||
|
|
3
thread.c
3
thread.c
|
@ -3050,8 +3050,11 @@ VALUE
|
|||
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);
|
||||
|
|
Загрузка…
Ссылка в новой задаче