MutexedStats is the start of a threadsafe
Stats class. Currently, on MRI Ruby the Stats object is already threadsafe, so there is no
need to use MutexedStats.
Public Class Methods
new()click to toggle source
# File lib/hitimes/mutexed_stats.rb, line 15definitialize@mutex = Mutex.newend
Public Instance Methods
update( val ) → nilclick to toggle source
Update the running stats with the new value in a threadsafe manner.
# File lib/hitimes/mutexed_stats.rb, line 24defupdate( value )
@mutex.synchronizedosuper( value )
endend