Class: P2p2::ConcurrentHash
- Inherits:
-
Hash
- Object
- Hash
- P2p2::ConcurrentHash
- Defined in:
- lib/p2p2/concurrent_hash.rb
Instance Method Summary collapse
- #[](*args) ⇒ Object
- #[]=(*args) ⇒ Object
- #clear(*args) ⇒ Object
- #delete(*args) ⇒ Object
- #each(*args) ⇒ Object
- #include?(*args) ⇒ Boolean
-
#initialize ⇒ ConcurrentHash
constructor
A new instance of ConcurrentHash.
- #select(*args) ⇒ Object
Constructor Details
#initialize ⇒ ConcurrentHash
Returns a new instance of ConcurrentHash.
3 4 5 6 |
# File 'lib/p2p2/concurrent_hash.rb', line 3 def initialize super @mutex = Mutex.new end |
Instance Method Details
#[](*args) ⇒ Object
8 9 10 |
# File 'lib/p2p2/concurrent_hash.rb', line 8 def []( *args ) @mutex.synchronize { super } end |
#[]=(*args) ⇒ Object
12 13 14 |
# File 'lib/p2p2/concurrent_hash.rb', line 12 def []=( *args ) @mutex.synchronize { super } end |
#clear(*args) ⇒ Object
16 17 18 |
# File 'lib/p2p2/concurrent_hash.rb', line 16 def clear( *args ) @mutex.synchronize { super } end |
#delete(*args) ⇒ Object
20 21 22 |
# File 'lib/p2p2/concurrent_hash.rb', line 20 def delete( *args ) @mutex.synchronize { super } end |
#each(*args) ⇒ Object
24 25 26 |
# File 'lib/p2p2/concurrent_hash.rb', line 24 def each( *args ) @mutex.synchronize { super } end |
#include?(*args) ⇒ Boolean
28 29 30 |
# File 'lib/p2p2/concurrent_hash.rb', line 28 def include?( *args ) @mutex.synchronize { super } end |
#select(*args) ⇒ Object
32 33 34 |
# File 'lib/p2p2/concurrent_hash.rb', line 32 def select( *args ) @mutex.synchronize { super } end |