Class: Empp::Utils::Hashtable
- Inherits:
-
Hash
- Object
- Hash
- Empp::Utils::Hashtable
- Defined in:
- lib/empp/utils/hashtable.rb
Instance Method Summary collapse
- #delete(key) ⇒ Object
- #get(key) ⇒ Object
-
#initialize ⇒ Hashtable
constructor
A new instance of Hashtable.
- #put(key, value) ⇒ Object
Constructor Details
#initialize ⇒ Hashtable
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 |