summaryrefslogtreecommitdiff
path: root/test/ruby/test_thread.rb
AgeCommit message (Collapse)Author
2016-01-13test_thread.rb: wait for the thread to sleepnobu
* test/ruby/test_thread.rb (test_thread_name): wait for the status of the subject thread to fix, so that the status does not change between two inspect methods. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53520 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-01-07thread.c: interrupt queue on uninitialized threadnobu
* thread.c (rb_thread_pending_interrupt_p): no pending interrupt before initialization. * thread.c (thread_raise_m, rb_thread_kill): uninitialized thread cannot interrupt. [ruby-core:72732] [Bug #11959] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53449 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-12-16Add frozen_string_literal: false for all filesnaruse
When you change this to true, you may need to add more tests. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53141 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-12-12test_thread.rb: stay alivenobu
* test/ruby/test_thread.rb (test_thread_name): the target thread needs to stay alive till the end of this test, so that inspected result would not change. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53055 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-12-04thread.c: name must be ascii-compatiblenobu
* thread.c (rb_thread_setname): name must be ascii-compatible, as pthread APIs do not accept legacy wide char strings. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52876 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-12-01thread.c: reset namenobu
* thread.c (rb_thread_setname): allow to reset thread name. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52835 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-12-01thread.c: check name argumentnobu
* thread.c (rb_thread_setname): check the argument if valid string. [ruby-core:71774] [Bug #11756] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52834 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-10-29wait until it escape handle_interrupt blocknaruse
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52334 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-10-28thread may leak if assert fails before join is finishednaruse
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52330 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-10-05* test/ruby/test_thread.rb (test_handle_interrupt_blocking): check ifnagachika
exception handling was postponed until sleep. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52043 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-10-05* test/ruby/test_thread.rb: fix potential race condition.eregon
The thread could have a "sleep" status because it tries to acquire the mutex, but does not have it yet. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52041 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-10-02test_thread.rb: handshakenobu
* test/ruby/test_thread.rb (test_handle_interrupt_blocking): add handshake. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52002 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-10-02test_thread.rb: thread leaknobu
* test/ruby/test_thread.rb (test_handle_interrupt_blocking): fix thread leak. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52001 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-09-15* test/ruby/test_thread.rb (TestThread#test_mutex_synchronize):kosaki
insert waste loop for invoking preemptive thread context switch. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51868 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-06-17* include/ruby/ruby.h: $SAFE=3 is now obsolete.hsbt
* ext/socket/init.c, ext/socket/socket.c, ext/socket/tcpsocket.c ext/socket/udpsocket.c, gc.c, object.c, re.c, safe.c: removed code for $SAFE=3 * bootstraptest/test_method.rb, test/erb/test_erb.rb, test/ruby/test_dir.rb test/ruby/test_file.rb, test/ruby/test_method.rb, test/ruby/test_regexp.rb test/ruby/test_thread.rb: remove tests for $SAFE=3 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50932 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-06-13sleep thread until assertionsnaruse
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50866 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-06-13* vm_core.h (rb_thread_t): add th->name.naruse
* vm.c (th_init): initialize th->name. * thread.c (Init_Thread): add Thread.name and Thread.name=. * thread.c (rb_thread_inspect): show thread's name if set. * thread.c (rb_thread_getname): defined. * thread.c (rb_thread_setname): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50863 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-04-16thread.c: class name encodingnobu
* thread.c (thread_s_new): preserve the encoding of the class name in an error message. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50328 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-12-29thread.c: fix dynamic symbol keysnobu
* thread.c (rb_thread_variable_get): fix dynamic symbol keys. rb_check_id() returns non-zero only for static symbols, whereas thread local variable keys can be dynamic symbols. [ruby-core:67185] [Bug #10667] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49055 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-11-13* test/lib/envutil.rb: Moved from test/ruby/.akr
* test/lib/find_executable.rb: Ditto. * test/lib/memory_status.rb: Ditto. * test/lib/test/unit.rb: require envutil. * test/: Don't require envutil in test files. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48409 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-09-22Fix a typo.akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47687 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-09-22test_thread.rb: thread for Queuenobu
* test/ruby/test_thread.rb (test_main_thread_status_at_exit): require 'thread' for Queue. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47682 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-09-21(test_main_thread_status_at_exit) wait until the thread enter the begin clause. akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47668 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-08-20test_thread.rb: let main thread exit from Thread.newnobu
* test/ruby/test_thread.rb (test_main_thread_status_at_exit): let the main thread run to ensure exiting from Thread.new. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47224 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-05-28test_thread.rb: move thread switch testnobu
* test/ruby/test_thread.rb (test_switch_while_busy_loop): move from test/test_timeout.rb. [Bug #1402] * test/test_timeout.rb (test_timeout): no longer related to [Bug #1402]. [Bug #8523] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46196 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-05-26thread.c: preserve encodingnobu
* thread.c (rb_thread_inspect): preserve encoding of the class name. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46135 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-05-18output more verbose to debugnaruse
following failure insists unexpected condition http://c5664.rubyci.org/~chkbuild/ruby-trunk/log/20140515T133301Z.diff.html.gz git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45989 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-05-10thread.c: stop if forked in a sub-threadnobu
* thread.c (thread_start_func_2): stop if forked in a sub-thread, the thread has become the main thread. [ruby-core:62070] [Bug #9751] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45899 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-05-10test_thread.rb: run with default handlernobu
* test/ruby/test_thread.rb (test_thread_timer_and_interrupt): run with default handler. * test/ruby/test_thread.rb (test_thread_{join,value}_in_trap): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45895 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-03-05* test/ruby: get rid of warnings.usa
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45273 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-01-16test_thread.rb: stop at oncenobu
* test/ruby/test_thread.rb (test_priority): stop both threads at once by a flag. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44627 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-12-16suppress warning: SAFE=3 does no sandboxingnaruse
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44229 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-12-14test_thread.rb: timing issuesnobu
* test/ruby/test_thread.rb: get rid of timing issues and reduce sleep times. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44216 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-12-14test_thread.rb: assert_operator for comparisonnobu
* test/ruby/test_thread.rb (test_priority): use assert_operator for comparison instead of assert_send. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44215 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-12-13test/ruby: better assertionsnobu
* test/ruby: use better assertions instead of mere assert. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44173 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-12-03hash.c: same hash value for similar constructsnobu
* hash.c (rb_hash_recursive): make similar (recursive) constructs return same hash value. execute recursively, and rewind to the topmost frame with an object which .eql? to the recursive object, if recursion is detected. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43981 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-11-26should not ignore the rest of recursive constructsnobu
* array.c (rb_ary_hash): should not ignore the rest of recursive constructs. * hash.c (rb_hash_hash): ditto. * range.c (range_hash): ditto. * struct.c (rb_struct_hash): ditto. * test/-ext-/test_recursion.rb (TestRecursion): separate from test/ruby/test_thread.rb. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43860 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-11-05* test/ruby/test_thread.rb (test_thread_join_in_trap):akr
Run the test in a different process. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43540 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-10-09test: use assert_raisenobu
* test/ruby, test/-ext-: use assert_raise instead of assert_raises. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43211 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-10-06test_thread.rb: ignore meaningless testnobu
* test/ruby/test_thread.rb (test_blocking_mutex_unlocked_on_fork): ignore meaningless test on platforms where fork() is not supported. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43152 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-10-05thread.c: fix some mutexes remaining locked after forkingnobu
* thread.c (terminate_atfork_i): fix locking mutexes not unlocked in forks when not tracked in thread. [ruby-core:55102] [Bug #8433] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43148 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-09-10* thread.c (rb_mutex_unlock): Mutex#unlock no longer raisekosaki
an exception even if uses on trap. [Bug #8891] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42906 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-08-18* variable.c, vm_method.c: remove dead code.ktsj
* test/ruby/test_fiber.rb, test/ruby/test_thread.rb: change accordingly. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42610 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-06-13* test/ruby/test_thread.rb (test_thread_local_security): Don't createakr
an unused thread. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41276 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-06-12* safe.c (rb_set_safe_level, safe_setter): raise an ArgumentErrorshugo
when $SAFE is set to 4. $SAFE=4 is now obsolete. [ruby-core:55222] [Feature #8468] * object.c (rb_obj_untrusted, rb_obj_untrust, rb_obj_trust): Kernel#untrusted?, untrust, and trust are now deprecated. Their behavior is same as tainted?, taint, and untaint, respectively. * include/ruby/ruby.h (OBJ_UNTRUSTED, OBJ_UNTRUST): OBJ_UNTRUSTED() and OBJ_UNTRUST() are aliases of OBJ_TAINTED() and OBJ_TAINT(), respectively. * array.c, class.c, debug.c, dir.c, encoding.c, error.c, eval.c, ext/curses/curses.c, ext/dbm/dbm.c, ext/dl/cfunc.c, ext/dl/cptr.c, ext/dl/dl.c, ext/etc/etc.c, ext/fiddle/fiddle.c, ext/fiddle/pointer.c, ext/gdbm/gdbm.c, ext/readline/readline.c, ext/sdbm/init.c, ext/socket/ancdata.c, ext/socket/basicsocket.c, ext/socket/socket.c, ext/socket/udpsocket.c, ext/stringio/stringio.c, ext/syslog/syslog.c, ext/tk/tcltklib.c, ext/win32ole/win32ole.c, file.c, gc.c, hash.c, io.c, iseq.c, load.c, marshal.c, object.c, proc.c, process.c, random.c, re.c, safe.c, string.c, thread.c, transcode.c, variable.c, vm_insnhelper.c, vm_method.c, vm_trace.c: remove code for $SAFE=4. * test/dl/test_dl2.rb, test/erb/test_erb.rb, test/readline/test_readline.rb, test/readline/test_readline_history.rb, test/ruby/test_alias.rb, test/ruby/test_array.rb, test/ruby/test_dir.rb, test/ruby/test_encoding.rb, test/ruby/test_env.rb, test/ruby/test_eval.rb, test/ruby/test_exception.rb, test/ruby/test_file_exhaustive.rb, test/ruby/test_hash.rb, test/ruby/test_io.rb, test/ruby/test_method.rb, test/ruby/test_module.rb, test/ruby/test_object.rb, test/ruby/test_pack.rb, test/ruby/test_rand.rb, test/ruby/test_regexp.rb, test/ruby/test_settracefunc.rb, test/ruby/test_struct.rb, test/ruby/test_thread.rb, test/ruby/test_time.rb: remove tests for $SAFE=4. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41259 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-05-02* test/ruby/test_process.rb (TestProcess#test_no_curdir): maybe nowusa
we can test it. * test/ruby/test_thread.rb (TestThread#test_thread_timer_and_interrupt): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40550 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-03-29thread.c: Mutex#synchronize no block paramsnobu
* thread.c (rb_mutex_synchronize_m): yield no block params. patch by splattael (Peter Suschlik) in [ruby-core:53773] [Bug #8097]. fix GH-266. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40000 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-02-16* test/ruby/test_thread.rb: fixed typoayumin
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@39277 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-12-23* thread.c: rename methods:ko1
from Thread.async_interrupt_timing to Thread.handle_interrupt, from Thread.async_interrupted? to Thread.pending_interrupt?. Also rename option from `defer' to `never'. [ruby-core:51074] [ruby-trunk - Feature #6762] * vm_core.c, thread.c: rename functions and data structure `async_errinfo' to `pending_interrupt'. * thread.c: add global variables sym_immediate, sym_on_blocking and sym_never. * cont.c, process.c, vm.c, signal.c: ditto. * lib/sync.rb, lib/thread.rb: catch up this renaming. * test/ruby/test_thread.rb: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38577 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-12-21test_thread.rb: descriptive assertionsnobu
* test/ruby/test_thread.rb: (test_local_barrier), (test_status_and_stop_p, test_recursive_outer, test_stack_size): use more descriptive assertions. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38520 b2dd03c8-39d4-4d8f-98ff-823fe69b080e