From c6f5fc2de190dfb19fa8f02de71934bf85db3147 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: http://svn.ruby-lang.org/repos/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 34bb5362b..43dac0be5 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