Sha256: b6784c8413ebb5dbe604398e646444958af0c82aa3418297ad344bd1d4bc4632
Contents?: true
Size: 280 Bytes
Versions: 9
Compression:
Stored size: 280 Bytes
Contents
# frozen_string_literal: true module Griffin class CountingSemaphore def initialize(size) @size = size @queue = Queue.new @size.times { @queue.push(0) } end def wait @queue.pop end def signal @queue.push(0) end end end
Version data entries
9 entries across 9 versions & 1 rubygems