new(file, thread_safe = false)public
PStore objects are always reentrant. But if thread_safe is set to true, then it will become thread-safe at the cost of a minor performance hit.
# File lib/pstore.rb, line 122 def initialize(file, thread_safe = false) dir = File::dirname(file) unless File::directory? dir raise PStore::Error, format("directory %s does not exist", dir) end if File::exist? file and not File::readable? file raise PStore::Error, format("file %s not readable", file) end @transaction = false @filename = file @abort = false @ultra_safe = false @thread_safe = thread_safe if @thread_safe @lock = Mutex.new else @lock = DummyMutex.new end end