Project

General

Profile

Bug #10443 » rb-mutex-unlock-fork-test.rb

benweint (Ben Weintraub), 10/28/2014 03:41 PM

 
#!/usr/bin/env ruby

$lock = Mutex.new

10.times do
Thread.new do
Thread.current.abort_on_exception = true
loop do
$lock.synchronize do
end
end
end
end

loop do
$stderr.write '.'
child_pid = $lock.synchronize do
Process.fork
end

if child_pid
Process.wait(child_pid)
else
$lock.synchronize do
end
exit 0
end
end
(1-1/3)