Class: Empp::Utils::Hashtable

Inherits:
Hash
  • Object
show all
Defined in:
lib/empp/utils/hashtable.rb

Instance Method Summary collapse

Constructor Details

#initializeHashtable

Returns a new instance of Hashtable.



9
10
11
12
# File 'lib/empp/utils/hashtable.rb', line 9

def initialize
  super
  @mutex = Mutex.new
end

Instance Method Details

#delete(key) ⇒ Object



26
27
28
29
30
# File 'lib/empp/utils/hashtable.rb', line 26

def delete(key)
  @mutex.synchronize{
    super(key)
  }
end

#get(key) ⇒ Object



20
21
22
23
24
# File 'lib/empp/utils/hashtable.rb', line 20

def get(key)
  @mutex.synchronize{
    self[key]
  }
end

#put(key, value) ⇒ Object



14
15
16
17
18
# File 'lib/empp/utils/hashtable.rb', line 14

def put(key, value)
  @mutex.synchronize{
    self[key] = value
  }
end