about summary refs log tree commit homepage
path: root/lib/tdb.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/tdb.rb')
-rw-r--r--lib/tdb.rb14
1 files changed, 14 insertions, 0 deletions
diff --git a/lib/tdb.rb b/lib/tdb.rb
index 2a75193..67114c9 100644
--- a/lib/tdb.rb
+++ b/lib/tdb.rb
@@ -1,2 +1,16 @@
 # -*- encoding: binary -*-
 require 'tdb_ext'
+class TDB
+  autoload :MT, 'tdb/mt'
+
+  # makes the current TDB object thread-safe
+  def threadsafe!
+    extend MT
+  end
+
+  # will return true when TDB::MT is included in TDB or the TDB
+  # object is extended by TDB
+  def threadsafe?
+    false
+  end
+end