Diff
Modified: MacRuby/trunk/lib/dispatch/future.rb (3468 => 3469)
--- MacRuby/trunk/lib/dispatch/future.rb 2010-02-09 23:25:06 UTC (rev 3468)
+++ MacRuby/trunk/lib/dispatch/future.rb 2010-02-09 23:25:29 UTC (rev 3469)
@@ -6,11 +6,11 @@
class Future < Dispatch::Group
# Create a future that asynchronously dispatches the block
- # to a concurrent queue of the specified (optional) +priority+
- def initialize(priority=nil, &block)
+ # to the default queue
+ def initialize(&block)
super
@value = nil
- Dispatch.group(self, priority) { @value = block.call }
+ Dispatch.group(self, nil) { @value = block.call }
end
# Waits for the computation to finish
@@ -34,8 +34,8 @@
# (optional) +priority+ as part of a Future, which is returned for use with
# +join+ or +value+ -- or as a Group, of which it is a subclass
- def fork(priority=nil, &block)
- Dispatch::Future.new(priority) &block
+ def fork(&block)
+ Dispatch::Future.new &block
end
module_function :fork
Modified: MacRuby/trunk/spec/macruby/library/dispatch/dispatch_spec.rb (3468 => 3469)
--- MacRuby/trunk/spec/macruby/library/dispatch/dispatch_spec.rb 2010-02-09 23:25:06 UTC (rev 3468)
+++ MacRuby/trunk/spec/macruby/library/dispatch/dispatch_spec.rb 2010-02-09 23:25:29 UTC (rev 3469)
@@ -80,7 +80,7 @@
g = Dispatch.fork { @actee.delay_set(42) }
$dispatch_gval.should == 0
g.should be_kind_of Dispatch::Future
- #g.join
+ g.join
$dispatch_gval.should == 42
end
@@ -89,7 +89,7 @@
g = Dispatch.fork { @actee.delay_set(42) }
$dispatch_gval.should == 0
g.should be_kind_of Dispatch::Group
- #g.wait
+ g.wait
$dispatch_gval.should == 42
end
end
Modified: MacRuby/trunk/spec/macruby/library/dispatch/future_spec.rb (3468 => 3469)
--- MacRuby/trunk/spec/macruby/library/dispatch/future_spec.rb 2010-02-09 23:25:06 UTC (rev 3468)
+++ MacRuby/trunk/spec/macruby/library/dispatch/future_spec.rb 2010-02-09 23:25:29 UTC (rev 3469)
@@ -20,7 +20,7 @@
end
describe :join do
- it "should wait until execution is complete"
+ it "should wait until execution is complete" do
@result.should == 0
@future.join
@result.should == 2**5