Add posix-y compatibility extension class over Mach::Semaphore.
This commit is contained in:
1 parent
680527cbab
commit
8158666e90
3 files changed
+133
-2
No files matched your search
@@ -98,14 +98,13 @@ module ProcessShared
|
||||
|
||||
it 'returns after waiting if another processes posts' do
|
||||
Semaphore.open(0) do |sem|
|
||||
start = Time.now.to_f
|
||||
|
||||
pid = fork do
|
||||
sleep 0.01
|
||||
sem.post
|
||||
Kernel.exit!
|
||||
end
|
||||
|
||||
start = Time.now.to_f
|
||||
sem.try_wait(0.1)
|
||||
(Time.now.to_f - start).must be_lt(0.1)
|
||||
|
||||
|
||||
Reference in new issue
Block a user