Skip to content

Commit ca7ea24

Browse files
committed
Update documentation
1 parent 9f8633b commit ca7ea24

File tree

3 files changed

+14
-9
lines changed

3 files changed

+14
-9
lines changed

doc/synchronization.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
> Quotations are used for notes.
22
3+
> This is an outdated version of
4+
> [this document](https://docs.google.com/document/d/1pVzU8w_QF44YzUCCab990Q_WZOdhpKolCIHaiXG-sPw/edit?usp=sharing)
5+
> maintained on Google documents.
6+
37
> This document is work-in-progress.
48
> Intentions of this effort and document are: to summarize the behavior
59
> of Ruby in concurrent and parallel environment, initiate discussion,
@@ -145,7 +149,7 @@ in parallel environment but it may loose updates, or raise Exceptions. (If
145149
in a single thread.)
146150

147151
> `concurrent-ruby` contains synchronized versions of `Array` and `Hash` and
148-
> other thread-safe data structure.
152+
> other thread-safe data structure.
149153
150154
> TODO: This section needs more work: e.g. Thread.raise and similar is an open
151155
> issue, better not to be used.

lib/concurrent/synchronization.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020

2121
module Concurrent
2222
# {include:file:doc/synchronization.md}
23+
# {include:file:doc/synchronization-notes.md}
2324
module Synchronization
2425
end
2526
end

lib/concurrent/synchronization/object.rb

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,13 @@ module Synchronization
2222
# - volatile instance variables see {Object.attr_volatile_with_cas}
2323
class Object < ObjectImplementation
2424

25+
# @!method self.attr_volatile(*names)
26+
# Creates methods for reading and writing (as `attr_accessor` does) to a instance variable with
27+
# volatile (Java) semantic. The instance variable should be accessed oly through generated methods.
28+
#
29+
# @param [Array<Symbol>] names of the instance variables to be volatile
30+
# @return [Array<Symbol>] names of defined method names
31+
2532
# Has to be called by children.
2633
def initialize
2734
super
@@ -122,13 +129,6 @@ def self.volatile_cas_fields(inherited = true)
122129
@volatile_cas_fields
123130
end
124131

125-
# @!method self.attr_volatile(*names)
126-
# Creates methods for reading and writing (as `attr_accessor` does) to a instance variable with
127-
# volatile (Java) semantic. The instance variable should be accessed oly through generated methods.
128-
#
129-
# @param [Array<Symbol>] names of the instance variables to be volatile
130-
# @return [Array<Symbol>] names of defined method names
131-
132132
private
133133

134134
def self.define_initialize_volatile_with_cas
@@ -137,7 +137,7 @@ def self.define_initialize_volatile_with_cas
137137
def initialize_volatile_with_cas
138138
super
139139
#{assignments}
140-
end
140+
end
141141
RUBY
142142
end
143143

0 commit comments

Comments
 (0)