# File 'lib/concurrent/collection/lock_free_stack.rb', line 24
-
-defnext_node
- self
-end
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/docs/1.1.0/Concurrent/Map.html b/docs/1.1.0/Concurrent/Map.html
index 2db3bae01..588182cbf 100644
--- a/docs/1.1.0/Concurrent/Map.html
+++ b/docs/1.1.0/Concurrent/Map.html
@@ -108,12 +108,6 @@
Overview
does. For most uses it should do fine though, and we recommend you consider
Concurrent::Map instead of Concurrent::Hash for your concurrency-safe hash needs.
-
This method is atomic. Atomic methods of Map which accept a block
-do not allow the self instance to be used within the block. Doing
-so will cause a deadlock.
+
+
+ Note:
+
Atomic methods taking a block do not allow the self instance
+to be used within the block. Doing so will cause a deadlock.
+
+
+
+
Compute and store new value for key.
+This method is atomic.
+
Parameters:
+
+
+
+ key
+
+
+ (Object)
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
# File 'lib/concurrent/map.rb', line 54
-
-
-
-
-
+
Yields:
+
+
+
+
+
+
+
+
+
+
+
compute new value from old one
-
-
-
+
+
- #compute_if_absent ⇒ undocumented
+
+
Yield Parameters:
+
-
+
+
+ old_value
+
+
+ (Object, nil)
+
+
+
+ —
+
old_value, or nil when key is absent
+
+
+
-
+
+
Yield Returns:
+
-
-
-
This method is atomic. Atomic methods of Map which accept a block
-do not allow the self instance to be used within the block. Doing
-so will cause a deadlock.
This method is atomic. Atomic methods of Map which accept a block
-do not allow the self instance to be used within the block. Doing
-so will cause a deadlock.
+
+
+ Note:
+
Atomic methods taking a block do not allow the self instance
+to be used within the block. Doing so will cause a deadlock.
+
+
+
+
Compute and store new value for key if the key is absent.
+This method is atomic.
+
Parameters:
+
+
+
+ key
+
+
+ (Object)
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
# File 'lib/concurrent/map.rb', line 51
-
-
-
-
-
+
Yields:
+
+
+
+
+
+
+
+
+
+
+
new value
-
-
-
+
+
- #delete ⇒ undocumented
+
+
Yield Returns:
+
-
+
+
+
+ (Object)
+
+
+
+ —
+
new value
+
+
+
-
+
+
Returns:
+
-
-
-
This method is atomic. Atomic methods of Map which accept a block
-do not allow the self instance to be used within the block. Doing
-so will cause a deadlock.
This method is atomic. Atomic methods of Map which accept a block
-do not allow the self instance to be used within the block. Doing
-so will cause a deadlock.
+
+
+ Note:
+
Atomic methods taking a block do not allow the self instance
+to be used within the block. Doing so will cause a deadlock.
+
+
+
+
Compute and store new value for key if the key is present.
+This method is atomic.
- #each_pair ⇒ undocumented
+ #fetch(key, default_value = NULL) {|key| ... } ⇒ Object
- Also known as:
- each
-
+
+
+
+
+
+
+ Note:
+
The "fetch-then-act" methods of Map are not atomic. Map is intended
+to be use as a concurrency primitive with strong happens-before
+guarantees. It is not intended to be used as a high-level abstraction
+supporting complex operations. All read and write operations are
+thread safe, but no guarantees are made regarding race conditions
+between the fetch operation and yielding to the block. Additionally,
+this method does not support recursion. This is due to internal
+constraints that are very unlikely to change in the near future.
+
+
+
+
Get a value with key, or default_value when key is absent,
+or fail when no default_value is given.
Atomic methods taking a block do not allow the self instance
+to be used within the block. Doing so will cause a deadlock.
+
+
+
+
Fetch value with key, or store default value when key is absent,
+or fail when no default_value is given. This is a two step operation,
+therefore not atomic. The store can overwrite other concurrently
+stored value.
+This method is atomic.
- #fetch(key, default_value = NULL) ⇒ undocumented
+ #key(value) ⇒ Object?
+ Also known as:
+ index
+
+
-
The "fetch-then-act" methods of Map are not atomic. Map is intended
-to be use as a concurrency primitive with strong happens-before
-guarantees. It is not intended to be used as a high-level abstraction
-supporting complex operations. All read and write operations are
-thread safe, but no guarantees are made regarding race conditions
-between the fetch operation and yielding to the block. Additionally,
-this method does not support recursion. This is due to internal
-constraints that are very unlikely to change in the near future.
The "fetch-then-act" methods of Map are not atomic. Map is intended
-to be use as a concurrency primitive with strong happens-before
-guarantees. It is not intended to be used as a high-level abstraction
-supporting complex operations. All read and write operations are
-thread safe, but no guarantees are made regarding race conditions
-between the fetch operation and yielding to the block. Additionally,
-this method does not support recursion. This is due to internal
-constraints that are very unlikely to change in the near future.
+
All keys
+
Returns:
+
+
+
+
+
+ (::Array<Object>)
+
+
+
+ —
+
keys
+
+
+
+
+
@@ -1280,19 +2231,19 @@
-125
-126
-127
-128
-129
+222
+223
+224
+225
+226
-
# File 'lib/concurrent/map.rb', line 125
+
# File 'lib/concurrent/map.rb', line 222
-deffetch_or_store(key,default_value=NULL)
- fetch(key)do
- put(key,block_given??yield(key):(NULL==default_value?raise_fetch_no_key:default_value))
- end
+defkeys
+ arr=[]
+ each_pair{|k,v|arr<<k}
+ arrend
This method is atomic. Atomic methods of Map which accept a block
-do not allow the self instance to be used within the block. Doing
-so will cause a deadlock.
+
+
+ Note:
+
Atomic methods taking a block do not allow the self instance
+to be used within the block. Doing so will cause a deadlock.
+
+
+
+
If the key is absent, the value is stored, otherwise new value is
+computed with a block.
+This method is atomic.
This method is atomic. Atomic methods of Map which accept a block
-do not allow the self instance to be used within the block. Doing
-so will cause a deadlock.
+
Replaces current value with new_value if key exists
+This method is atomic.
This method is atomic. Atomic methods of Map which accept a block
-do not allow the self instance to be used within the block. Doing
-so will cause a deadlock.
+
Replaces old_value with new_value if key exists and current value
+matches old_value
+This method is atomic.
+
Parameters:
+
-
-
-
-
-
-
-
-
-
-
-
# File 'lib/concurrent/map.rb', line 45
-
-
-
-
-
-
-
-
-
+
+
+ key
+
+
+ (Object)
+
+
+
+
- #replace_if_exists ⇒ undocumented
+
+
+ old_value
+
+
+ (Object)
+
+
+
+
-
+
+
+ new_value
+
+
+ (Object)
+
+
+
+
+
+
Returns:
+
-
-
-
This method is atomic. Atomic methods of Map which accept a block
-do not allow the self instance to be used within the block. Doing
-so will cause a deadlock.
This method is atomic. Atomic methods of Map which accept a block
-do not allow the self instance to be used within the block. Doing
-so will cause a deadlock.
+
The size of map.
-
-
-
-
-
-
-
-
-
-
-
# File 'lib/concurrent/map.rb', line 60
-
-
-
-
-
-
-
-
-
-
- #size ⇒ undocumented
+
Returns:
+
-
+
+
+
+ (Integer)
+
+
+
+ —
+
size
+
+
+
+
-
-
+
-186
-187
-188
-189
-190
+285
+286
+287
+288
+289
-
# File 'lib/concurrent/map.rb', line 186
+
# File 'lib/concurrent/map.rb', line 285defsizecount=0
- each_pair{|k,v|count+=1}
+ each_pair{|k,v|count+=1}countend
-
-
\ No newline at end of file
diff --git a/docs/index.html b/docs/index.html
index 7f0143a61..222e7cc9e 100644
--- a/docs/index.html
+++ b/docs/index.html
@@ -63,7 +63,7 @@
# File 'lib/concurrent/collection/lock_free_stack.rb', line 24
-
-defnext_node
- self
-end
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/docs/master/Concurrent/Map.html b/docs/master/Concurrent/Map.html
index 9dcb5930d..588182cbf 100644
--- a/docs/master/Concurrent/Map.html
+++ b/docs/master/Concurrent/Map.html
@@ -1432,7 +1432,7 @@
# File 'lib/concurrent/map.rb', line 241defeach_key
- each_pair{|k,v|yieldk}
+ each_pair{|k,v|yieldk}end
@@ -1637,7 +1637,7 @@
# File 'lib/concurrent/map.rb', line 250defeach_value
- each_pair{|k,v|yieldv}
+ each_pair{|k,v|yieldv}end
@@ -1691,7 +1691,7 @@
# File 'lib/concurrent/map.rb', line 278defempty?
- each_pair{|k,v|returnfalse}
+ each_pair{|k,v|returnfalse}trueend
@@ -2181,7 +2181,7 @@
# File 'lib/concurrent/map.rb', line 270defkey(value)
- each_pair{|k,v|returnkifv==value}
+ each_pair{|k,v|returnkifv==value}nilend