diff --git a/lib/process_shared/mutex.rb b/lib/process_shared/mutex.rb index 1aab1ed..2b31d58 100644 --- a/lib/process_shared/mutex.rb +++ b/lib/process_shared/mutex.rb @@ -108,13 +108,8 @@ module ProcessShared end end - def with_internal_lock - @internal_sem.wait - begin - yield - ensure - @internal_sem.post - end + def with_internal_lock(&block) + @internal_sem.synchronize &block end end end