Class: P2p2::ConcurrentHash

Inherits:
Hash
  • Object
show all
Defined in:
lib/p2p2/concurrent_hash.rb

Instance Method Summary collapse

Constructor Details

#initializeConcurrentHash

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

Returns:

  • (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