From 0a14d73b63966dae97b267ae5aa165f7ada78edb Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Fri, 10 Dec 2010 09:30:33 +0000 Subject: tdb: allow enabling the thread-safety option Maybe it's still broken... --- lib/metropolis/tdb.rb | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'lib') diff --git a/lib/metropolis/tdb.rb b/lib/metropolis/tdb.rb index d734443..dac613d 100644 --- a/lib/metropolis/tdb.rb +++ b/lib/metropolis/tdb.rb @@ -18,6 +18,13 @@ module Metropolis::TDB size = @query['hash_size'] and @tdb_opts[:hash_size] = size.to_i hash = @query['hash'] and @tdb_opts[:hash] = hash.to_sym + case @query['threadsafe'] + when 'true'; @tdb_opts[:threadsafe] = true + when 'false', nil + else + raise ArgumentError, "'threadsafe' must be 'true' or 'false'" + end + case @query['volatile'] when 'true'; @tdb_opts[:tdb_flags] |= TDB::VOLATILE when 'false', nil -- cgit v1.2.3-24-ge0c7