lib/celluloid/io/common_methods.rb in celluloid-io-0.11.0 vs lib/celluloid/io/common_methods.rb in celluloid-io-0.12.0
- old
+ new
@@ -37,11 +37,12 @@
when :w
ivar = :@write_owner
else raise ArgumentError, "invalid ownership type: #{type}"
end
- Actor.current.wait(self) while instance_variable_get(ivar)
+ # Celluloid needs a better API here o_O
+ Thread.current[:actor].wait(self) while instance_variable_get(ivar)
instance_variable_set(ivar, Task.current)
end
# Release ownership for a particular operation
# Type should be one of :r (read) or :w (write)
@@ -56,10 +57,10 @@
else raise ArgumentError, "invalid ownership type: #{type}"
end
raise "not owner" unless instance_variable_get(ivar) == Task.current
instance_variable_set(ivar, nil)
- Actor.current.signal(self)
+ Thread.current[:actor].signal(self)
end
def read(length = nil, buffer = nil)
buffer ||= ''
remaining = length