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

ruby-changes:17376

From: usa <ko1@a...>
Date: Fri, 1 Oct 2010 15:12:46 +0900 (JST)
Subject: [ruby-changes:17376] Ruby:r29380 (ruby_1_8): * ext/-test-/threadswitch/threadswitch_hook.c (event_hook,

usa	2010-10-01 15:09:55 +0900 (Fri, 01 Oct 2010)

  New Revision: 29380

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

  Log:
    * ext/-test-/threadswitch/threadswitch_hook.c (event_hook,
      threadswitch_event_hook, restore_hook, threadswitch_hook): use
      rb_thread_current() instead of rb_curr_thread->thread, because
      the latter is not a public interface. this change fixes build
      problem on Windows.

  Modified files:
    branches/ruby_1_8/ChangeLog
    branches/ruby_1_8/ext/-test-/threadswitch/threadswitch_hook.c

Index: ruby_1_8/ext/-test-/threadswitch/threadswitch_hook.c
===================================================================
--- ruby_1_8/ext/-test-/threadswitch/threadswitch_hook.c	(revision 29379)
+++ ruby_1_8/ext/-test-/threadswitch/threadswitch_hook.c	(revision 29380)
@@ -45,7 +45,7 @@
     ID mid;
     VALUE klass;
 {
-    VALUE block = rb_thread_local_aref(rb_curr_thread->thread, event_callback);
+    VALUE block = rb_thread_local_aref(rb_thread_current(), event_callback);
     if (!NIL_P(block)) {
 	VALUE args = rb_ary_new();
 	rb_ary_push(args, rb_str_new2(get_event_name(event)));
@@ -72,7 +72,7 @@
     rb_threadswitch_event_t event;
     VALUE thread;
 {
-    VALUE block = rb_thread_local_aref(rb_curr_thread->thread, event_callback);
+    VALUE block = rb_thread_local_aref(rb_thread_current(), event_callback);
     if (!NIL_P(block)) {
 	VALUE args = rb_ary_new();
 	rb_ary_push(args, rb_str_new2(get_threadswitch_event_name(event)));
@@ -109,7 +109,7 @@
 {
     VALUE *save = (VALUE *)arg;
     threadswitch_remove_event_hook(save[0]);
-    rb_thread_local_aset(rb_curr_thread->thread, event_callback, save[1]);
+    rb_thread_local_aset(rb_thread_current(), event_callback, save[1]);
     return Qnil;
 }
 
@@ -118,8 +118,8 @@
     VALUE klass;
 {
     VALUE save[2];
-    save[1] = rb_thread_local_aref(rb_curr_thread->thread, event_callback);
-    rb_thread_local_aset(rb_curr_thread->thread, event_callback, rb_block_proc());
+    save[1] = rb_thread_local_aref(rb_thread_current(), event_callback);
+    rb_thread_local_aset(rb_thread_current(), event_callback, rb_block_proc());
     save[0] = threadswitch_add_event_hook(klass);
     return rb_ensure(rb_yield, save[0], restore_hook, (VALUE)save);
 }
Index: ruby_1_8/ChangeLog
===================================================================
--- ruby_1_8/ChangeLog	(revision 29379)
+++ ruby_1_8/ChangeLog	(revision 29380)
@@ -1,3 +1,11 @@
+Fri Oct  1 15:07:30 2010  NAKAMURA Usaku  <usa@r...>
+
+	* ext/-test-/threadswitch/threadswitch_hook.c (event_hook,
+	  threadswitch_event_hook, restore_hook, threadswitch_hook): use
+	  rb_thread_current() instead of rb_curr_thread->thread, because
+	  the latter is not a public interface. this change fixes build
+	  problem on Windows.
+
 Sat Sep 25 21:56:25 2010  KOSAKI Motohiro  <kosaki.motohiro@g...>
 
 	* configure.in: Always add -mieee for Renesas SH4.

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

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