1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59432 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
eregon 2017-07-27 12:10:41 +00:00
parent 819977e410
commit 0cb5fa5877
21 changed files with 329 additions and 461 deletions

View file

@ -111,9 +111,6 @@ module ThreadSpecs
status
end
def self.status_of_aborting_thread
end
def self.status_of_killed_thread
t = Thread.new { sleep }
Thread.pass while t.status and t.status != 'sleep'
@ -147,6 +144,19 @@ module ThreadSpecs
status
end
def self.status_of_dying_thread_after_sleep
status = nil
t = dying_thread_ensures {
Thread.stop
status = Status.new(Thread.current)
}
Thread.pass while t.status and t.status != 'sleep'
t.wakeup
Thread.pass while t.status and t.status == 'sleep'
t.join
status
end
def self.dying_thread_ensures(kill_method_name=:kill)
Thread.new do
begin