From be8bdd3c574e0dad8203ca144e0113693b5dc496 Mon Sep 17 00:00:00 2001 From: usa Date: Fri, 1 Oct 2010 06:09:55 +0000 Subject: [PATCH] * 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. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@29380 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 8 ++++++++ ext/-test-/threadswitch/threadswitch_hook.c | 10 +++++----- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index a037e4ed1b..9119e88669 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +Fri Oct 1 15:07:30 2010 NAKAMURA Usaku + + * 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 * configure.in: Always add -mieee for Renesas SH4. diff --git a/ext/-test-/threadswitch/threadswitch_hook.c b/ext/-test-/threadswitch/threadswitch_hook.c index 18d80bdde4..36fff6f619 100644 --- a/ext/-test-/threadswitch/threadswitch_hook.c +++ b/ext/-test-/threadswitch/threadswitch_hook.c @@ -45,7 +45,7 @@ event_hook(event, node, obj, mid, klass) 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 @@ threadswitch_event_hook(event, thread) 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 @@ restore_hook(arg) { 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 @@ threadswitch_hook(klass) 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); }