module ThreadSafe
Constants
- Array
-
Because MRI never runs code in parallel, the existing non-thread-safe structures should usually work fine.
- ConcurrentCacheBackend
- Hash
- NULL
-
Various classes within allows for
nil
values to be stored, so a specialNULL
token is required to indicate the “nil-ness”. - VERSION
Public Class Methods
Source
# File lib/thread_safe.rb, line 49 def self.allocate obj = super obj.send(:_mon_initialize) obj end
Calls superclass method
Public Instance Methods
Source
# File lib/thread_safe.rb, line 45 def _mon_initialize @_monitor = Monitor.new unless @_monitor # avoid double initialisation end