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

ruby-changes:6377

From: nobu <ko1@a...>
Date: Sat, 5 Jul 2008 22:29:12 +0900 (JST)
Subject: [ruby-changes:6377] Ruby:r17893 (mvm): * merged from trunk r17888:17892.

nobu	2008-07-05 22:28:55 +0900 (Sat, 05 Jul 2008)

  New Revision: 17893

  Modified files:
    branches/mvm/.merged-trunk-revision
    branches/mvm/ChangeLog
    branches/mvm/process.c
    branches/mvm/test/ruby/test_m17n_comb.rb
    branches/mvm/thread.c
    branches/mvm/thread_pthread.c
    branches/mvm/thread_win32.c

  Log:
    * merged from trunk r17888:17892.

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

Index: mvm/thread_win32.c
===================================================================
--- mvm/thread_win32.c	(revision 17892)
+++ mvm/thread_win32.c	(revision 17893)
@@ -546,8 +546,6 @@
     w32_set_event(th->native_thread_data.interrupt_event);
 }
 
-static void timer_thread_function(void);
-
 static HANDLE timer_thread_id = 0;
 
 static unsigned long _stdcall
@@ -556,7 +554,7 @@
     thread_debug("timer_thread\n");
     while (system_working) {
 	Sleep(WIN32_WAIT_TIMEOUT);
-	timer_thread_function();
+	timer_thread_function(dummy);
     }
     thread_debug("timer killed\n");
     return 0;
@@ -566,7 +564,7 @@
 rb_thread_create_timer_thread(void)
 {
     if (timer_thread_id == 0) {
-	timer_thread_id = w32_create_thread(1024, timer_thread_func, 0);
+	timer_thread_id = w32_create_thread(1024, timer_thread_func, GET_VM());
 	w32_resume_thread(timer_thread_id);
     }
 }
Index: mvm/ChangeLog
===================================================================
--- mvm/ChangeLog	(revision 17892)
+++ mvm/ChangeLog	(revision 17893)
@@ -1,3 +1,11 @@
+Sat Jul  5 22:22:27 2008  Nobuyoshi Nakada  <nobu@r...>
+
+	* thread.c (thread_initialize): NUM2INT() returns int.
+
+	* thread.c (timer_thread_function), thread_pthread.c (thread_timer),
+	  thread_win32.c (timer_thread_func), thread_{pthread,win32}.c
+	  (rb_thread_create_timer_thread): passing VM.
+
 Sat Jul  5 20:53:18 2008  Masaki Suketa  <masaki.suketa@n...>
 
 	* test/win32ole/test_word.rb: check word installed.
Index: mvm/thread_pthread.c
===================================================================
--- mvm/thread_pthread.c	(revision 17892)
+++ mvm/thread_pthread.c	(revision 17893)
@@ -734,7 +734,6 @@
 }
 
 static pthread_t timer_thread_id;
-static void timer_thread_function(void);
 
 static void *
 thread_timer(void *dummy)
@@ -763,7 +762,7 @@
 	    });
 	}
 #endif
-	timer_thread_function();
+	timer_thread_function(dummy);
     }
     return NULL;
 }
@@ -781,7 +780,7 @@
 #ifdef PTHREAD_STACK_MIN
 	pthread_attr_setstacksize(&attr, PTHREAD_STACK_MIN);
 #endif
-	err = pthread_create(&timer_thread_id, &attr, thread_timer, 0);
+	err = pthread_create(&timer_thread_id, &attr, thread_timer, GET_VM());
 	if (err != 0) {
 	    rb_bug("rb_thread_create_timer_thread: return non-zero (%d)", err);
 	}
Index: mvm/thread.c
===================================================================
--- mvm/thread.c	(revision 17892)
+++ mvm/thread.c	(revision 17893)
@@ -151,6 +151,7 @@
 #endif
 NOINLINE(static int thread_start_func_2(rb_thread_t *th, VALUE *stack_start,
 					VALUE *register_stack_start));
+static void timer_thread_function(void *);
 
 #if   defined(_WIN32)
 #include "thread_win32.c"
@@ -498,7 +499,7 @@
 	    rb_raise(rb_eThreadError, "already initialized thread - %s",
 		     file);
 	}
-        rb_raise(rb_eThreadError, "already initialized thread - %s:%ld",
+        rb_raise(rb_eThreadError, "already initialized thread - %s:%d",
                  file, NUM2INT(line));
     }
     return thread_create_core(thread, args, 0);
@@ -2061,9 +2062,9 @@
 int rb_get_next_signal(rb_vm_t *vm);
 
 static void
-timer_thread_function(void)
+timer_thread_function(void *arg)
 {
-    rb_vm_t *vm = GET_VM(); /* TODO: fix me for Multi-VM */
+    rb_vm_t *vm = arg; /* TODO: fix me for Multi-VM */
 
     /* for time slice */
     RUBY_VM_SET_TIMER_INTERRUPT(vm->running_thread);
Index: mvm/process.c
===================================================================
--- mvm/process.c	(revision 17892)
+++ mvm/process.c	(revision 17893)
@@ -2778,7 +2778,11 @@
  *
  *  If a hash is given as +env+, the environment is
  *  updated by +env+ before <code>exec(2)</code> in the child process.
+ *  If a pair in +env+ has nil as the value, the variable is deleted.
  *
+ *    # set FOO as BAR and unset BAZ.
+ *    pid = spawn({"FOO"=>"BAR", "BAZ"=>nil}, command)
+ *
  *  If a hash is given as +options+,
  *  it specifies
  *  process group,
Index: mvm/.merged-trunk-revision
===================================================================
--- mvm/.merged-trunk-revision	(revision 17892)
+++ mvm/.merged-trunk-revision	(revision 17893)
@@ -1 +1 @@
-17888
+17892
Index: mvm/test/ruby/test_m17n_comb.rb
===================================================================
--- mvm/test/ruby/test_m17n_comb.rb	(revision 17892)
+++ mvm/test/ruby/test_m17n_comb.rb	(revision 17893)
@@ -1122,6 +1122,8 @@
 
   def test_str_slice!
     each_slice_call {|s, *args|
+      desc_slice = "#{encdump s}.slice#{encdumpargs args}"
+      desc_slice_bang = "#{encdump s}.slice!#{encdumpargs args}"
       t = s.dup
       begin
         r = t.slice!(*args)
@@ -1129,14 +1131,14 @@
         e = $!
       end
       if e
-        assert_raise(e.class, "#{encdump s}.slice#{encdumpargs args}") { s.slice(*args) }
+        assert_raise(e.class, desc_slice) { s.slice(*args) }
         next
       end
       if !r
-        assert_nil(s.slice(*args))
+        assert_nil(s.slice(*args), desc_slice)
         next
       end
-      assert_equal(s.slice(*args), r)
+      assert_equal(s.slice(*args), r, desc_slice_bang)
       assert_equal(s.bytesize, r.bytesize + t.bytesize)
       if args.length == 1 && String === args[0]
         assert_equal(args[0].encoding, r.encoding,

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

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