ruby-changes:6501
From: nobu <ko1@a...>
Date: Fri, 11 Jul 2008 06:25:57 +0900 (JST)
Subject: [ruby-changes:6501] Ruby:r18017 (mvm): * merged from trunk r17977:18016.
nobu 2008-07-11 06:25:32 +0900 (Fri, 11 Jul 2008) New Revision: 18017 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=18017 Log: * merged from trunk r17977:18016. Modified files: branches/mvm/.merged-trunk-revision branches/mvm/ChangeLog branches/mvm/KNOWNBUGS.rb branches/mvm/bootstraptest/test_thread.rb branches/mvm/common.mk branches/mvm/ext/coverage/coverage.c branches/mvm/include/ruby/win32.h branches/mvm/lib/pstore.rb branches/mvm/process.c branches/mvm/test/win32ole/test_win32ole_event.rb branches/mvm/test/win32ole/test_win32ole_method.rb branches/mvm/test/win32ole/test_win32ole_param.rb branches/mvm/test/win32ole/test_win32ole_type.rb branches/mvm/test/win32ole/test_win32ole_typelib.rb branches/mvm/thread.c branches/mvm/version.h branches/mvm/vm.c branches/mvm/vm_core.h branches/mvm/win32/win32.c Index: mvm/include/ruby/win32.h =================================================================== --- mvm/include/ruby/win32.h (revision 18016) +++ mvm/include/ruby/win32.h (revision 18017) @@ -134,7 +134,7 @@ #define utime(_p, _t) rb_w32_utime(_p, _t) #define lseek(_f, _o, _w) _lseeki64(_f, _o, _w) -#define pipe(p) _pipe(p, 65536L, 0) +#define pipe(p) _pipe(p, 65536L, _O_NOINHERIT) #define close(h) rb_w32_close(h) #define fclose(f) rb_w32_fclose(f) #define read(f, b, s) rb_w32_read(f, b, s) Index: mvm/ChangeLog =================================================================== --- mvm/ChangeLog (revision 18016) +++ mvm/ChangeLog (revision 18017) @@ -1,3 +1,67 @@ +Fri Jul 11 06:16:26 2008 Nobuyoshi Nakada <nobu@r...> + + * common.mk (process.o): depends on util.h. + +Fri Jul 11 05:07:46 2008 NAKAMURA Usaku <usa@r...> + + * include/ruby/win32.h (pipe): prohibit inheritance. + fixed: [ruby-dev:35421] + +Fri Jul 11 00:56:46 2008 Koichi Sasada <ko1@a...> + + * thread.c (thread_create_core): fix GC problem. + [ruby-core:17669] + +Thu Jul 10 22:06:00 2008 Nobuyoshi Nakada <nobu@r...> + + * lib/pstore.rb (PStore#transaction): return the result from the + block. [ruby-core:17718] + +Thu Jul 10 21:15:49 2008 Masaki Suketa <masaki.suketa@n...> + + * test/win32ole/test_win32ole_typelib.rb: add some illegal argument + test. + + * test/win32ole/test_win32ole_type.rb: ditto. + + * test/win32ole/test_win32ole_event.rb: ditto. + + * test/win32ole/test_win32ole_param.rb: ditto. + + * test/win32ole/test_win32ole_method.rb: ditto. + +Thu Jul 10 19:38:35 2008 wanabe <s.wanabe@g...> + * test/ruby/envutil.rb (assert_normal_exit): r17993 revert. + +Thu Jul 10 18:29:41 2008 wanabe <s.wanabe@g...> + * test/ruby/envutil.rb (assert_normal_exit): finish writing script + before spawn("ruby") to avoid blocking in win32. + +Thu Jul 10 17:20:50 2008 NAKAMURA Usaku <usa@r...> + + * win32/win32.c (insert): follow recent changes of globbing. + +Thu Jul 10 14:09:05 2008 Nobuyoshi Nakada <nobu@r...> + + * ext/coverage/coverage.c (rb_coverage_start): return nil. + +Thu Jul 10 12:41:56 2008 Nobuyoshi Nakada <nobu@r...> + + * thread.c (rb_thread_wait_for): fixed variable name. + +Thu Jul 10 12:09:58 2008 Nobuyoshi Nakada <nobu@r...> + + * vm_core.h (rb_thread_t), vm.c (rb_thread_mark), process.c + (rb_last_status_get, rb_last_status_set, rb_last_status_clear): + moved last_status from rb_vm_t. [ruby-dev:35414] + + * vm.c (th_init2): initialize last_status with nil. + +Thu Jul 10 12:09:21 2008 Nobuyoshi Nakada <nobu@r...> + + * thread.c (rb_thread_wait_for): wait until timed out only when + sleeping with timeout. + Wed Jul 9 22:41:16 2008 Nobuyoshi Nakada <nobu@r...> * thread.c (sleep_timeval): wait until timed out. [ruby-core:17270] Index: mvm/bootstraptest/test_thread.rb =================================================================== --- mvm/bootstraptest/test_thread.rb (revision 18016) +++ mvm/bootstraptest/test_thread.rb (revision 18017) @@ -355,3 +355,9 @@ sleep 1; m.lock :ok } + +assert_equal 'ok', %q{ + t = Thread.new {`echo`} + t.join + $? ? :ng : :ok +}, '[ruby-dev:35414]' Index: mvm/vm_core.h =================================================================== --- mvm/vm_core.h (revision 18016) +++ mvm/vm_core.h (revision 18017) @@ -312,7 +312,6 @@ st_table *living_threads; VALUE thgroup_default; - VALUE last_status; /* $? */ int running; int thread_abort_on_exception; @@ -423,6 +422,7 @@ rb_control_frame_t *cfp; int safe_level; int raised_flag; + VALUE last_status; /* $? */ /* passing state */ int state; Index: mvm/lib/pstore.rb =================================================================== --- mvm/lib/pstore.rb (revision 18016) +++ mvm/lib/pstore.rb (revision 18017) @@ -345,9 +345,9 @@ end end end + value ensure @transaction = false - value end private Index: mvm/thread.c =================================================================== --- mvm/thread.c (revision 18016) +++ mvm/thread.c (revision 18017) @@ -445,9 +445,9 @@ GetThreadPtr(thval, th); /* setup thread environment */ - th->first_args = args; + th->first_func = fn; th->first_proc = fn ? Qfalse : rb_block_proc(); - th->first_func = fn; + th->first_args = args; /* GC: shouldn't put before above line */ th->priority = GET_THREAD()->priority; th->thgroup = GET_THREAD()->thgroup; @@ -741,29 +741,7 @@ static void sleep_timeval(rb_thread_t *th, struct timeval tv) { - struct timeval to, tvn; - - getclockofday(&to); - to.tv_sec += tv.tv_sec; - if ((to.tv_usec += tv.tv_usec) >= 1000000) { - to.tv_sec++; - to.tv_usec -= 1000000; - } - - for (;;) { - native_sleep(th, &tv, 0); - getclockofday(&tvn); - if (to.tv_sec < tvn.tv_sec) break; - if (to.tv_sec == tvn.tv_sec && to.tv_usec <= tvn.tv_usec) break; - thread_debug("sleep_timeval: %ld.%.6ld > %ld.%.6ld\n", - (long)to.tv_sec, to.tv_usec, - (long)tvn.tv_sec, tvn.tv_usec); - tv.tv_sec = to.tv_sec - tvn.tv_sec; - if ((tv.tv_usec = to.tv_usec - tvn.tv_usec) < 0) { - --tv.tv_sec; - tv.tv_usec += 1000000; - } - } + native_sleep(th, &tv, 0); } void @@ -816,7 +794,29 @@ rb_thread_wait_for(struct timeval time) { rb_thread_t *th = GET_THREAD(); - sleep_timeval(th, time); + struct timeval to, tvn; + + getclockofday(&to); + to.tv_sec += time.tv_sec; + if ((to.tv_usec += time.tv_usec) >= 1000000) { + to.tv_sec++; + to.tv_usec -= 1000000; + } + + for (;;) { + sleep_timeval(th, time); + getclockofday(&tvn); + if (to.tv_sec < tvn.tv_sec) break; + if (to.tv_sec == tvn.tv_sec && to.tv_usec <= tvn.tv_usec) break; + thread_debug("sleep_timeval: %ld.%.6ld > %ld.%.6ld\n", + (long)to.tv_sec, to.tv_usec, + (long)tvn.tv_sec, tvn.tv_usec); + time.tv_sec = to.tv_sec - tvn.tv_sec; + if ((time.tv_usec = to.tv_usec - tvn.tv_usec) < 0) { + --time.tv_sec; + time.tv_usec += 1000000; + } + } } void Index: mvm/common.mk =================================================================== --- mvm/common.mk (revision 18016) +++ mvm/common.mk (revision 18017) @@ -516,7 +516,7 @@ {$(VPATH)}debug.h {$(VPATH)}vm_opts.h {$(VPATH)}id.h \ {$(VPATH)}thread_$(THREAD_MODEL).h {$(VPATH)}dln.h {$(VPATH)}gc.h process.$(OBJEXT): {$(VPATH)}process.c $(RUBY_H_INCLUDES) {$(VPATH)}st.h \ - {$(VPATH)}signal.h $(VM_CORE_H_INCLUDES) \ + {$(VPATH)}signal.h $(VM_CORE_H_INCLUDES) {$(VPATH)}util.h \ {$(VPATH)}node.h {$(VPATH)}debug.h {$(VPATH)}vm_opts.h {$(VPATH)}id.h \ {$(VPATH)}thread_$(THREAD_MODEL).h random.$(OBJEXT): {$(VPATH)}random.c $(RUBY_H_INCLUDES) \ Index: mvm/win32/win32.c =================================================================== --- mvm/win32/win32.c (revision 18016) +++ mvm/win32/win32.c (revision 18017) @@ -1039,7 +1039,7 @@ #define NTSTRING 0x4 // element contains a quoted string static int -insert(const char *path, VALUE vinfo) +insert(const char *path, VALUE vinfo, void *enc) { NtCmdLineElement *tmpcurr; NtCmdLineElement ***tail = (NtCmdLineElement ***)vinfo; Index: mvm/KNOWNBUGS.rb =================================================================== --- mvm/KNOWNBUGS.rb (revision 18016) +++ mvm/KNOWNBUGS.rb (revision 18017) @@ -2,4 +2,3 @@ # This test file concludes tests which point out known bugs. # So all tests will cause failure. # - Index: mvm/process.c =================================================================== --- mvm/process.c (revision 18016) +++ mvm/process.c (revision 18017) @@ -212,23 +212,22 @@ VALUE rb_last_status_get(void) { - return GET_VM()->last_status; + return GET_THREAD()->last_status; } void rb_last_status_set(int status, rb_pid_t pid) { - rb_vm_t *vm = GET_VM(); - vm->last_status = rb_obj_alloc(rb_cProcessStatus); - rb_iv_set(vm->last_status, "status", INT2FIX(status)); - rb_iv_set(vm->last_status, "pid", PIDT2NUM(pid)); + rb_thread_t *th = GET_THREAD(); + th->last_status = rb_obj_alloc(rb_cProcessStatus); + rb_iv_set(th->last_status, "status", INT2FIX(status)); + rb_iv_set(th->last_status, "pid", PIDT2NUM(pid)); } static void rb_last_status_clear(void) { - rb_vm_t *vm = GET_VM(); - vm->last_status = Qnil; + GET_THREAD()->last_status = Qnil; } /* Index: mvm/ext/coverage/coverage.c =================================================================== --- mvm/ext/coverage/coverage.c (revision 18016) +++ mvm/ext/coverage/coverage.c (revision 18017) @@ -30,6 +30,7 @@ RBASIC(coverages)->klass = 0; rb_set_coverages(coverages); } + return Qnil; } static int Index: mvm/.merged-trunk-revision =================================================================== --- mvm/.merged-trunk-revision (revision 18016) +++ mvm/.merged-trunk-revision (revision 18017) @@ -1 +1 @@ -17977 +18016 Index: mvm/vm.c =================================================================== --- mvm/vm.c (revision 18016) +++ mvm/vm.c (revision 18017) @@ -1384,7 +1384,6 @@ } RUBY_MARK_UNLESS_NULL(vm->thgroup_default); RUBY_MARK_UNLESS_NULL(vm->mark_object_ary); - RUBY_MARK_UNLESS_NULL(vm->last_status); RUBY_MARK_UNLESS_NULL(vm->load_path); RUBY_MARK_UNLESS_NULL(vm->loaded_features); RUBY_MARK_UNLESS_NULL(vm->top_self); @@ -1545,6 +1544,7 @@ RUBY_MARK_UNLESS_NULL(th->fiber); RUBY_MARK_UNLESS_NULL(th->root_fiber); RUBY_MARK_UNLESS_NULL(th->stat_insn_usage); + RUBY_MARK_UNLESS_NULL(th->last_status); RUBY_MARK_UNLESS_NULL(th->locking_mutex); @@ -1593,6 +1593,7 @@ th->status = THREAD_RUNNABLE; th->errinfo = Qnil; + th->last_status = Qnil; #if USE_VALUE_CACHE th->value_cache_ptr = &th->value_cache[0]; Index: mvm/version.h =================================================================== --- mvm/version.h (revision 18016) +++ mvm/version.h (revision 18017) @@ -1,7 +1,7 @@ #define RUBY_VERSION "1.9.0" -#define RUBY_RELEASE_DATE "2008-07-09" +#define RUBY_RELEASE_DATE "2008-07-11" #define RUBY_VERSION_CODE 190 -#define RUBY_RELEASE_CODE 20080709 +#define RUBY_RELEASE_CODE 20080711 #define RUBY_PATCHLEVEL 0 #define RUBY_VERSION_MAJOR 1 @@ -9,7 +9,7 @@ #define RUBY_VERSION_TEENY 0 #define RUBY_RELEASE_YEAR 2008 #define RUBY_RELEASE_MONTH 7 -#define RUBY_RELEASE_DAY 9 +#define RUBY_RELEASE_DAY 11 #ifdef RUBY_EXTERN RUBY_EXTERN const char ruby_version[]; Index: mvm/test/win32ole/test_win32ole_method.rb =================================================================== --- mvm/test/win32ole/test_win32ole_method.rb (revision 18016) +++ mvm/test/win32ole/test_win32ole_method.rb (revision 18017) @@ -33,6 +33,9 @@ assert_raise(WIN32OLERuntimeError) { method = WIN32OLE_METHOD.new(ole_type, "NonExistMethod") } + assert_raise(TypeError) { + method = WIN32OLE_METHOD.new(ole_type, 1) + } method = WIN32OLE_METHOD.new(ole_type, "Open") assert_instance_of(WIN32OLE_METHOD, method) method = WIN32OLE_METHOD.new(ole_type, "open") Index: mvm/test/win32ole/test_win32ole_param.rb =================================================================== --- mvm/test/win32ole/test_win32ole_param.rb (revision 18016) +++ mvm/test/win32ole/test_win32ole_param.rb (revision 18017) @@ -29,6 +29,13 @@ @param_overwritefiles = m_copyfile.params[2] end + def test_s_new + assert_raise(ArgumentError) { + WIN32OLE_PARAM.new("hoge") + } + end + + def test_name assert_equal('URL', @param_url.name) assert_equal('Flags', @param_flags.name) Index: mvm/test/win32ole/test_win32ole_event.rb =================================================================== --- mvm/test/win32ole/test_win32ole_event.rb (revision 18016) +++ mvm/test/win32ole/test_win32ole_event.rb (revision 18017) @@ -30,6 +30,12 @@ @event += event end + def test_s_new + assert_raise(TypeError) { + ev = WIN32OLE_EVENT.new("A") + } + end + def test_s_new_without_itf ev = WIN32OLE_EVENT.new(@ie) ev.on_event {|*args| default_handler(*args)} Index: mvm/test/win32ole/test_win32ole_type.rb =================================================================== --- mvm/test/win32ole/test_win32ole_type.rb (revision 18016) +++ mvm/test/win32ole/test_win32ole_type.rb (revision 18017) @@ -22,6 +22,12 @@ assert_raise(ArgumentError) { WIN32OLE_TYPE.new("foo") } + assert_raise(TypeError) { + WIN32OLE_TYPE.new(1, 2) + } + assert_raise(TypeError) { + WIN32OLE_TYPE.new("Microsoft Shell Controls And Automation", 1) + } assert_raise(WIN32OLERuntimeError) { WIN32OLE_TYPE.new("Microsoft Shell Controls And Automation", "foo") } Index: mvm/test/win32ole/test_win32ole_typelib.rb =================================================================== --- mvm/test/win32ole/test_win32ole_typelib.rb (revision 18016) +++ mvm/test/win32ole/test_win32ole_typelib.rb (revision 18017) @@ -18,6 +18,11 @@ assert_raise(ArgumentError) { WIN32OLE_TYPELIB.new(1,2,3,4) } + + assert_raise(TypeError) { + WIN32OLE_TYPELIB.new(100) + } + tlib = WIN32OLE_TYPELIB.new("Microsoft Shell Controls And Automation") assert_instance_of(WIN32OLE_TYPELIB, tlib) -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/