From 0089455e53628edf94060b56203279ad59c32553 Mon Sep 17 00:00:00 2001 From: ko1 Date: Thu, 12 Apr 2007 08:14:54 +0000 Subject: * thread.c (mutex_try_lock): check and set owner thread. * thread_pthread.ci: fix to show error code in error message. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12173 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- thread_pthread.ci | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'thread_pthread.ci') diff --git a/thread_pthread.ci b/thread_pthread.ci index 34bb5362b9..43dac0be5a 100644 --- a/thread_pthread.ci +++ b/thread_pthread.ci @@ -48,16 +48,18 @@ native_mutex_trylock(pthread_mutex_t *lock) void native_mutex_initialize(pthread_mutex_t *lock) { - if (pthread_mutex_init(lock, 0) != 0) { - rb_bug("native_mutex_initialize return non-zero"); + int r = pthread_mutex_init(lock, 0); + if (r != 0) { + rb_bug("native_mutex_initialize return non-zero: %d", r); } } void native_mutex_destroy(pthread_mutex_t *lock) { - if (pthread_mutex_destroy(lock) != 0) { - rb_bug("native_mutex_destroy return non-zero"); + int r = pthread_mutex_destroy(lock); + if (r != 0) { + rb_bug("native_mutex_destroy return non-zero: %d", r); } } -- cgit v1.2.3