diff options
author | normal <normal@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2016-01-02 12:08:34 +0000 |
---|---|---|
committer | normal <normal@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2016-01-02 12:08:34 +0000 |
commit | 90d8f719d3c73e9ca1e00d36dc369369b8035bcd (patch) | |
tree | 73d0da2e4bd3357669772654025046a423a85182 /thread_sync.c | |
parent | 1fa0581e87a848d6e84651dafb30e2e81ed8d487 (diff) | |
download | ruby-90d8f719d3c73e9ca1e00d36dc369369b8035bcd.tar.gz |
thread_sync.c: remove unnecessary casts for queue_sleep
"Qfalse" and "(VALUE)0" are equivalent, and do not matter
for an ignored argument, either.
Additionally, there's no reason to cast the pointer to
rb_thread_sleep_deadly when we already have a queue_sleep
wrapper.
* thread_sync.c (queue_do_pop): avoid cast with Qfalse
(rb_szqueue_push): ditto, use queue_sleep wrapper
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53413 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'thread_sync.c')
-rw-r--r-- | thread_sync.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/thread_sync.c b/thread_sync.c index 9c73654b0f..e270b12538 100644 --- a/thread_sync.c +++ b/thread_sync.c @@ -786,7 +786,7 @@ queue_do_pop(VALUE self, int should_block) assert(queue_closed_p(self) == 0); rb_ary_push(args.waiting, args.th); - rb_ensure(queue_sleep, (VALUE)0, queue_delete_from_waiting, (VALUE)&args); + rb_ensure(queue_sleep, Qfalse, queue_delete_from_waiting, (VALUE)&args); } } @@ -1012,7 +1012,7 @@ rb_szqueue_push(int argc, VALUE *argv, VALUE self) } else { rb_ary_push(args.waiting, args.th); - rb_ensure((VALUE (*)())rb_thread_sleep_deadly, (VALUE)0, queue_delete_from_waiting, (VALUE)&args); + rb_ensure(queue_sleep, Qfalse, queue_delete_from_waiting, (VALUE)&args); } } |