mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00

in Mac OS X port. the use of them is strongly discouraged. * eval.c (rb_remove_threadswitch_hook): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@29326 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
16 lines
449 B
Ruby
16 lines
449 B
Ruby
require 'test/unit'
|
|
require '-test-/threadswitch/event_hook'
|
|
require 'ruby/envutil'
|
|
|
|
class Test_ThreadSwitch < Test::Unit::TestCase
|
|
def test_threadswitch_init
|
|
threads = []
|
|
warning = EnvUtil.verbose_warning {
|
|
EventHook::ThreadSwitch.hook {|name, thread|
|
|
threads << thread if name == "thread-init"
|
|
}
|
|
}
|
|
assert_match(/not an official API/, warning)
|
|
assert_operator(threads, :include?, Thread.current)
|
|
end
|
|
end
|