about summary refs log tree commit
path: root/lib/metropolis/tdb.rb
diff options
context:
space:
mode:
authorEric Wong <e@yhbt.net>2010-12-10 09:30:33 +0000
committerEric Wong <normalperson@yhbt.net>2010-12-10 18:48:10 -0800
commit0a14d73b63966dae97b267ae5aa165f7ada78edb (patch)
tree422712a3754b384e1d40db0ee8e514bfa46223e1 /lib/metropolis/tdb.rb
parent88fa90b7f039f62962cc8d11031446412b951be2 (diff)
downloadmetropolis-0a14d73b63966dae97b267ae5aa165f7ada78edb.tar.gz
tdb: allow enabling the thread-safety option
Maybe it's still broken...
Diffstat (limited to 'lib/metropolis/tdb.rb')
-rw-r--r--lib/metropolis/tdb.rb7
1 files changed, 7 insertions, 0 deletions
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