File tree Expand file tree Collapse file tree 2 files changed +11
-11
lines changed
lib/concurrent/synchronization Expand file tree Collapse file tree 2 files changed +11
-11
lines changed Original file line number Diff line number Diff line change @@ -2,19 +2,19 @@ module Concurrent
2
2
module Synchronization
3
3
class MonitorObject < MutexObject
4
4
def initialize ( *args , &block )
5
- @__lock__do_not_use_directly = ::Monitor . new
6
- @__condition__do_not_use_directly = @__lock__do_not_use_directly . new_cond
5
+ @__lock__ = ::Monitor . new
6
+ @__condition__ = @__lock__ . new_cond
7
7
synchronize { ns_initialize ( *args , &block ) }
8
8
end
9
9
10
10
private
11
11
12
12
def synchronize
13
- @__lock__do_not_use_directly . synchronize { yield }
13
+ @__lock__ . synchronize { yield }
14
14
end
15
15
16
16
def ns_wait ( timeout = nil )
17
- @__condition__do_not_use_directly . wait timeout
17
+ @__condition__ . wait timeout
18
18
self
19
19
end
20
20
end
Original file line number Diff line number Diff line change @@ -2,33 +2,33 @@ module Concurrent
2
2
module Synchronization
3
3
class MutexObject < AbstractObject
4
4
def initialize ( *args , &block )
5
- @__lock__do_not_use_directly = ::Mutex . new
6
- @__condition__do_not_use_directly = ::ConditionVariable . new
5
+ @__lock__ = ::Mutex . new
6
+ @__condition__ = ::ConditionVariable . new
7
7
synchronize { ns_initialize ( *args , &block ) }
8
8
end
9
9
10
10
private
11
11
12
12
def synchronize
13
- if @__lock__do_not_use_directly . owned?
13
+ if @__lock__ . owned?
14
14
yield
15
15
else
16
- @__lock__do_not_use_directly . synchronize { yield }
16
+ @__lock__ . synchronize { yield }
17
17
end
18
18
end
19
19
20
20
def ns_signal
21
- @__condition__do_not_use_directly . signal
21
+ @__condition__ . signal
22
22
self
23
23
end
24
24
25
25
def ns_broadcast
26
- @__condition__do_not_use_directly . broadcast
26
+ @__condition__ . broadcast
27
27
self
28
28
end
29
29
30
30
def ns_wait ( timeout = nil )
31
- @__condition__do_not_use_directly . wait @__lock__do_not_use_directly , timeout
31
+ @__condition__ . wait @__lock__ , timeout
32
32
self
33
33
end
34
34
You can’t perform that action at this time.
0 commit comments