[前][次][番号順一覧][スレッド一覧][生データ]

yarv-diff:266

From: ko1 atdot.net
Date: 15 Feb 2006 13:40:56 -0000
Subject: [yarv-diff:266] r429 - in trunk: . test/ruby

Author: ko1
Date: 2006-02-15 22:40:56 +0900 (Wed, 15 Feb 2006)
New Revision: 429

Modified:
   trunk/
   trunk/ChangeLog
   trunk/eval_method.h
   trunk/test.rb
   trunk/test/ruby/test_readpartial.rb
   trunk/test/ruby/test_signal.rb
   trunk/thread.c
Log:
 r648@lermite:  ko1 | 2006-02-15 22:39:52 +0900
 	* eval_method.h : move rb_clear_cache_by_id position
 
 	* thread.c : fix Thread#kill
 
 	* test/ruby/test_readpartial.rb : enable tests except cygwin version
 
 	* test/ruby/test_signal.rb : ditto and enable timeout
 



Property changes on: trunk
___________________________________________________________________
Name: svk:merge
   - 81cd9672-7512-7e48-ae48-6936450e977d:/local/yarv/trunk:638
   + 81cd9672-7512-7e48-ae48-6936450e977d:/local/yarv/trunk:648

Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog	2006-02-15 13:13:31 UTC (rev 428)
+++ trunk/ChangeLog	2006-02-15 13:40:56 UTC (rev 429)
@@ -4,6 +4,17 @@
 #  from Mon, 03 May 2004 01:24:19 +0900
 #
 
+2006-02-15(Wed) 22:34:04 +0900  Koichi Sasada  <ko1 atdot.net>
+
+	* eval_method.h : move rb_clear_cache_by_id position
+
+	* thread.c : fix Thread#kill
+
+	* test/ruby/test_readpartial.rb : enable tests except cygwin version
+
+	* test/ruby/test_signal.rb : ditto and enable timeout
+
+
 2006-02-15(Wed) 22:13:29 +0900  Minero Aoki  <aamine loveruby.net>
 
 	* lib/runit: forgot to commit.
@@ -50,14 +61,6 @@
 	* yarvtest/test_method.rb : add a test for above
 
 
-2006-02-15(Wed) 19:47:51 +0900  Koichi Sasada  <ko1 atdot.net>
-
-	* insns.def, compile.c, vm.c : remove methoddef, singletonmethoddef
-	instructions and make new insn definemethod
-
-	* yarvcore.c : set toplevel visibility to private
-
-
 2006-02-15(Wed) 19:48:59 +0900  Minero Aoki  <aamine loveruby.net>
 
 	* test/rss: imported from Ruby CVS trunk HEAD.

Modified: trunk/eval_method.h
===================================================================
--- trunk/eval_method.h	2006-02-15 13:13:31 UTC (rev 428)
+++ trunk/eval_method.h	2006-02-15 13:40:56 UTC (rev 429)
@@ -532,8 +532,7 @@
     }
 
     orig_fbody->nd_cnt++;
-    rb_clear_cache_by_id(name);
-
+    
     if (RTEST(ruby_verbose) &&
 	st_lookup(RCLASS(klass)->m_tbl, name, (st_data_t *) & node)) {
 	if (node->nd_cnt == 0 && node->nd_body) {
@@ -547,6 +546,8 @@
 			     orig_fbody->nd_body->nd_clss,
 			     orig_fbody->nd_body->nd_noex), def));
 
+    rb_clear_cache_by_id(name);
+
     if (singleton) {
 	rb_funcall(singleton, singleton_added, 1, ID2SYM(name));
     }

Modified: trunk/test/ruby/test_readpartial.rb
===================================================================
--- trunk/test/ruby/test_readpartial.rb	2006-02-15 13:13:31 UTC (rev 428)
+++ trunk/test/ruby/test_readpartial.rb	2006-02-15 13:40:56 UTC (rev 429)
@@ -48,7 +48,7 @@
       w << 'abc'
       assert_equal('ab', r.readpartial(2))
       assert_equal('c', r.readpartial(2))
-assert false, "TODO: doesn't work on cygwin"
+assert false, "TODO: doesn't work on cygwin" if /cygwin/ =~ RUBY_PLATFORM
       assert_raises(TimeoutError) {
         timeout(0.1) { r.readpartial(2) }
       }
@@ -63,7 +63,7 @@
       assert_equal("de", r.readpartial(2))
       assert_equal("f\n", r.readpartial(4096))
       assert_equal("ghi\n", r.readpartial(4096))
-assert false, "TODO: doesn't work on cygwin"
+assert false, "TODO: doesn't work on cygwin" if /cygwin/ =~ RUBY_PLATFORM
       assert_raises(TimeoutError) {
         timeout(0.1) { r.readpartial(2) }
       }

Modified: trunk/test/ruby/test_signal.rb
===================================================================
--- trunk/test/ruby/test_signal.rb	2006-02-15 13:13:31 UTC (rev 428)
+++ trunk/test/ruby/test_signal.rb	2006-02-15 13:40:56 UTC (rev 429)
@@ -34,7 +34,6 @@
 
   def test_exit_action
     return unless have_fork?	# snip this test
-assert false, "TODO: timeout causes unknown error"
     assert(false, "test_exit_action doesn't work on cygwin") if /cygwin/ =~ RUBY_PLATFORM
     begin
       r, w = IO.pipe

Modified: trunk/test.rb
===================================================================
--- trunk/test.rb	2006-02-15 13:13:31 UTC (rev 428)
+++ trunk/test.rb	2006-02-15 13:40:56 UTC (rev 429)
@@ -1,6 +1,19 @@
+p Proc === Proc.new{} #=> false
+__END__
+a = 1
+p []
 
 __END__
 
+require 'timeout'
+timeout(0.1){
+}
+loop{
+}
+  
+
+__END__
+
 class C
   def m
   end

Modified: trunk/thread.c
===================================================================
--- trunk/thread.c	2006-02-15 13:13:31 UTC (rev 428)
+++ trunk/thread.c	2006-02-15 13:40:56 UTC (rev 429)
@@ -113,17 +113,19 @@
 
 
 #define GVL_UNLOCK_RANGE(exec) do { \
-  yarv_thread_t *__th = GET_THREAD(); \
-  int __prev_status = __th->status; \
-  __th->status = THREAD_STOPPED; \
-  YARV_CHECK_INTS(); \
-  GVL_UNLOCK_BEGIN(); {\
-  exec; \
-  } \
-  GVL_UNLOCK_END(); \
-  yarv_remove_signal_thread_list(__th); \
-  __th->status = __prev_status; \
-  YARV_CHECK_INTS(); \
+    yarv_thread_t *__th = GET_THREAD(); \
+    int __prev_status = __th->status; \
+    __th->status = THREAD_STOPPED; \
+    YARV_CHECK_INTS(); \
+    GVL_UNLOCK_BEGIN(); {\
+	exec; \
+    } \
+    GVL_UNLOCK_END(); \
+    yarv_remove_signal_thread_list(__th); \
+    if (__th->status == THREAD_STOPPED) { \
+	__th->status = __prev_status; \
+    } \
+    YARV_CHECK_INTS(); \
 } while(0)
 
 VALUE th_eval_body(yarv_thread_t *th);
@@ -476,7 +478,7 @@
 static VALUE
 rb_thread_s_critical(VALUE self)
 {
-    rb_warn("Thread.critical is obsolete. Use Mutex instead.");
+    rb_warn("Thread.critical is unsupported.  Use Mutex instead.");
     return Qnil;
 }
 
@@ -651,6 +653,7 @@
 {
     yarv_thread_t *th;
     GetThreadVal(thread, th);
+    int status;
 
     if (th != GET_THREAD() && th->safe_level < 4) {
 	rb_secure(4);
@@ -661,10 +664,13 @@
     if (th == GET_VM()->main_thread) {
 	rb_exit(EXIT_SUCCESS);
     }
-
+    
+    status = th->status;
     th->throwed_errinfo = eKillSignal;
     th->status = THREAD_TO_KILL;
-    if (th->status == THREAD_STOPPED) {
+    th->interrupt_flag = 1;
+    
+    if (status == THREAD_STOPPED) {
 	native_thread_interrupt(th);
     }
     return thread;


-- 
ML: yarv-diff quickml.atdot.net
Info: http://www.atdot.net/~ko1/quickml

[前][次][番号順一覧][スレッド一覧][生データ]