diff options
author | normal <normal@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2018-08-21 01:01:42 +0000 |
---|---|---|
committer | normal <normal@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2018-08-21 01:01:42 +0000 |
commit | 79bdb6f9c8ca823c39ae49f053d41390bb37b86e (patch) | |
tree | 35bf89661005baa62ec9b44734a0db4392726b2f /thread.c | |
parent | 383d7dba121d385fcbaf8a00d64b068b3c35e553 (diff) | |
download | ruby-79bdb6f9c8ca823c39ae49f053d41390bb37b86e.tar.gz |
thread*.c: replace GetMutexPtr with mutex_ptr
Following ko1's lead in r59192, this gets rid of non-obvious
assignments which happen inside macros.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64490 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'thread.c')
-rw-r--r-- | thread.c | 8 |
1 files changed, 3 insertions, 5 deletions
@@ -4710,7 +4710,7 @@ rb_thread_shield_wait(VALUE self) rb_mutex_t *m; if (!mutex) return Qfalse; - GetMutexPtr(mutex, m); + m = mutex_ptr(mutex); if (m->th == GET_THREAD()) return Qnil; rb_thread_shield_waiting_inc(self); rb_mutex_lock(mutex); @@ -5197,8 +5197,7 @@ debug_deadlock_check(rb_vm_t *vm, VALUE msg) "native:%"PRI_THREAD_ID" int:%u", th->self, (void *)th, thread_id_str(th), th->ec->interrupt_flag); if (th->locking_mutex) { - rb_mutex_t *mutex; - GetMutexPtr(th->locking_mutex, mutex); + rb_mutex_t *mutex = mutex_ptr(th->locking_mutex); rb_str_catf(msg, " mutex:%p cond:%"PRIuSIZE, (void *)mutex->th, rb_mutex_num_waiting(mutex)); } @@ -5230,8 +5229,7 @@ rb_check_deadlock(rb_vm_t *vm) found = 1; } else if (th->locking_mutex) { - rb_mutex_t *mutex; - GetMutexPtr(th->locking_mutex, mutex); + rb_mutex_t *mutex = mutex_ptr(th->locking_mutex); if (mutex->th == th || (!mutex->th && !list_empty(&mutex->waitq))) { found = 1; |