ruby-changes:7054
From: ko1 <ko1@a...>
Date: Wed, 13 Aug 2008 17:21:42 +0900 (JST)
Subject: [ruby-changes:7054] Ruby:r18572 (trunk): * thread.c (rb_thread_check_ints): added. please note that
ko1 2008-08-13 17:21:24 +0900 (Wed, 13 Aug 2008) New Revision: 18572 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=18572 Log: * thread.c (rb_thread_check_ints): added. please note that this function may cause ruby's thread switching. * include/ruby/intern.h: ditto. * regint.h: use rb_thread_check_ints() instead of RUBY_CHECK_INTS() directly. Modified files: trunk/ChangeLog trunk/include/ruby/intern.h trunk/regint.h trunk/thread.c Index: include/ruby/intern.h =================================================================== --- include/ruby/intern.h (revision 18571) +++ include/ruby/intern.h (revision 18572) @@ -654,6 +654,7 @@ /* thread.c */ typedef void rb_unblock_function_t(void *); typedef VALUE rb_blocking_function_t(void *); +void rb_thread_check_ints(void); VALUE rb_thread_blocking_region(rb_blocking_function_t *func, void *data1, rb_unblock_function_t *ubf, void *data2); #define RB_UBF_DFL ((rb_unblock_function_t *)-1) Index: ChangeLog =================================================================== --- ChangeLog (revision 18571) +++ ChangeLog (revision 18572) @@ -1,3 +1,13 @@ +Wed Aug 13 17:18:37 2008 Koichi Sasada <ko1@a...> + + * thread.c (rb_thread_check_ints): added. please note that + this function may cause ruby's thread switching. + + * include/ruby/intern.h: ditto. + + * regint.h: use rb_thread_check_ints() instead of + RUBY_CHECK_INTS() directly. + Wed Aug 13 17:01:36 2008 Akinori MUSHA <knu@i...> * golf_prelude.rb, lib/set.rb (TC_Set#test_each), Index: thread.c =================================================================== --- thread.c (revision 18571) +++ thread.c (revision 18572) @@ -877,6 +877,19 @@ } } +/* + * CAUTION: This function causes thread switching. + * rb_thread_check_ints() check ruby's interrupts. + * some interrupt needs thread switching/invoke handlers, + * and so on. + */ + +void +rb_thread_check_ints(void) +{ + RUBY_VM_CHECK_INTS(); +} + struct timeval rb_time_timeval(); void Index: regint.h =================================================================== --- regint.h (revision 18571) +++ regint.h (revision 18572) @@ -115,8 +115,7 @@ #ifdef RUBY -#include "vm_core.h" -#define CHECK_INTERRUPT_IN_MATCH_AT RUBY_VM_CHECK_INTS() +#define CHECK_INTERRUPT_IN_MATCH_AT rb_thread_check_ints() #define onig_st_init_table st_init_table #define onig_st_init_table_with_size st_init_table_with_size #define onig_st_init_numtable st_init_numtable -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/