[前][次][番号順一覧][スレッド一覧]

ruby-changes:30798

From: nobu <ko1@a...>
Date: Sun, 8 Sep 2013 04:04:55 +0900 (JST)
Subject: [ruby-changes:30798] nobu:r42878 (trunk): thread.c: function cast

nobu	2013-09-08 04:04:37 +0900 (Sun, 08 Sep 2013)

  New Revision: 42878

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=42878

  Log:
    thread.c: function cast
    
    * ext/thread/thread.c (queue_sleep): get rid of casting function
      pointer.

  Modified files:
    trunk/ext/thread/thread.c
Index: ext/thread/thread.c
===================================================================
--- ext/thread/thread.c	(revision 42877)
+++ ext/thread/thread.c	(revision 42878)
@@ -256,6 +256,13 @@ queue_delete_from_waiting(struct waiting https://github.com/ruby/ruby/blob/trunk/ext/thread/thread.c#L256
 }
 
 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_bl https://github.com/ruby/ruby/blob/trunk/ext/thread/thread.c#L274
 	    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));

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]