diff --git a/lib/process_shared/posix/semaphore.rb b/lib/process_shared/posix/semaphore.rb index a1ef3a5..e72d1a6 100644 --- a/lib/process_shared/posix/semaphore.rb +++ b/lib/process_shared/posix/semaphore.rb @@ -55,7 +55,7 @@ module ProcessShared # resort). # # @param [Integer] value the initial semaphore value - def initialize(value) + def initialize(value = 1) @sem = SharedMemory.new(LibC.type_size(:sem_t)) sem_init(@sem, 1, value) ObjectSpace.define_finalizer(self, self.class.make_finalizer(@sem))