File tree Expand file tree Collapse file tree 2 files changed +18
-0
lines changed
lib/concurrent-ruby/concurrent/synchronization Expand file tree Collapse file tree 2 files changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -32,6 +32,12 @@ def initialize(*defaults)
3232 @__Condition__ = ::ConditionVariable . new
3333 end
3434
35+ def initialize_copy ( other )
36+ super
37+ @__Lock__ = ::Mutex . new
38+ @__Condition__ = ::ConditionVariable . new
39+ end
40+
3541 protected
3642
3743 def synchronize
@@ -61,6 +67,12 @@ def initialize(*defaults)
6167 @__Condition__ = @__Lock__ . new_cond
6268 end
6369
70+ def initialize_copy ( other )
71+ super
72+ @__Lock__ = ::Mutex . new
73+ @__Condition__ = @__Lock__ . new_cond
74+ end
75+
6476 protected
6577
6678 def synchronize # TODO may be a problem with lock.synchronize { lock.wait }
Original file line number Diff line number Diff line change @@ -12,6 +12,12 @@ def initialize(*defaults)
1212 @__owner__ = nil
1313 end
1414
15+ def initialize_copy ( other )
16+ super
17+ @__Waiters__ = [ ]
18+ @__owner__ = nil
19+ end
20+
1521 protected
1622
1723 def synchronize ( &block )
You can’t perform that action at this time.
0 commit comments