lib/thread/delay.rb in thread-0.0.4 vs lib/thread/delay.rb in thread-0.0.4.1
- old
+ new
@@ -11,9 +11,11 @@
# A delay is an object that incapsulates a block which is called upon
# value retrieval, and its result cached.
class Thread::Delay
# Create a delay with the passed block.
def initialize (&block)
+ raise ArgumentError, 'no block given' unless block
+
@mutex = Mutex.new
@block = block
end