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)
32
32
@__Condition__ = ::ConditionVariable . new
33
33
end
34
34
35
+ def initialize_copy ( other )
36
+ super
37
+ @__Lock__ = ::Mutex . new
38
+ @__Condition__ = ::ConditionVariable . new
39
+ end
40
+
35
41
protected
36
42
37
43
def synchronize
@@ -61,6 +67,12 @@ def initialize(*defaults)
61
67
@__Condition__ = @__Lock__ . new_cond
62
68
end
63
69
70
+ def initialize_copy ( other )
71
+ super
72
+ @__Lock__ = ::Mutex . new
73
+ @__Condition__ = @__Lock__ . new_cond
74
+ end
75
+
64
76
protected
65
77
66
78
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)
12
12
@__owner__ = nil
13
13
end
14
14
15
+ def initialize_copy ( other )
16
+ super
17
+ @__Waiters__ = [ ]
18
+ @__owner__ = nil
19
+ end
20
+
15
21
protected
16
22
17
23
def synchronize ( &block )
You can’t perform that action at this time.
0 commit comments