Displaying 1 result from an estimated 1 matches for "child_2".
Did you mean:
child_1
2007 May 04
1
Trying to get a good example for win32-mutex
...MMap.open(''test'')
mx = Win32::Mutex.open(MUTEXNAME)
5.times{
mx.wait
puts "child_1 wait "
mm.gvalue += 123
sleep 1
mm.gvalue -= 123
mx.release
puts "child_1 release "
}
exit 1
end
pid2 = Process.fork
# child_2
if pid2.nil?
mm = MMap.open(''test'')
mx = Win32::Mutex.open(MUTEXNAME)
4.times{
mx.wait
puts "child_2 wait "
mm.gvalue += 456
sleep 2
mm.gvalue -= 456
mx.release
puts "child_2 release "
}
exit 1
end
#pare...