diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-09-07 19:04:37 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-09-07 19:04:37 +0000 |
commit | 398c3cab6d15f13390ede357a9b054059ac156ae (patch) | |
tree | cf1ece0701937575eaf19df14815444d724e7fc7 /ext/thread/thread.c | |
parent | 9b6ee42d860497dcbf4e46facbfdfb1e0fe6ee23 (diff) | |
download | ruby-398c3cab6d15f13390ede357a9b054059ac156ae.tar.gz |
thread.c: function cast
* ext/thread/thread.c (queue_sleep): get rid of casting function
pointer.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42878 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/thread/thread.c')
-rw-r--r-- | ext/thread/thread.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/ext/thread/thread.c b/ext/thread/thread.c index 4065bc5b64..01eb234e9e 100644 --- a/ext/thread/thread.c +++ b/ext/thread/thread.c @@ -256,6 +256,13 @@ queue_delete_from_waiting(struct waiting_delete *p) } static VALUE +queue_sleep(VALUE arg) +{ + rb_thread_sleep_deadly(); + return Qnil; +} + +static VALUE queue_do_pop(VALUE self, VALUE should_block) { struct waiting_delete args; @@ -267,7 +274,7 @@ queue_do_pop(VALUE self, VALUE should_block) rb_raise(rb_eThreadError, "queue empty"); } 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, (VALUE)0, queue_delete_from_waiting, (VALUE)&args); } return rb_ary_shift(GET_QUEUE_QUE(self)); |