Use semaphore#synchronize convenience method internally.
This commit is contained in:
parent
1eff930480
commit
80284301a7
|
@ -108,13 +108,8 @@ module ProcessShared
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def with_internal_lock
|
def with_internal_lock(&block)
|
||||||
@internal_sem.wait
|
@internal_sem.synchronize &block
|
||||||
begin
|
|
||||||
yield
|
|
||||||
ensure
|
|
||||||
@internal_sem.post
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue