diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/tdb/mt.rb | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/tdb/mt.rb b/lib/tdb/mt.rb index 6742cc4..7e7a09d 100644 --- a/lib/tdb/mt.rb +++ b/lib/tdb/mt.rb @@ -5,14 +5,17 @@ module TDB::MT @lock = Mutex.new end - %w( + wrap_methods = %w( close closed? fetch [] store []= insert! modify! insert modify key? has_key? include? member? nuke! delete lockall trylockall unlockall lockall_read trylockall_read unlockall_read lockall_mark lockall_unmark - ).each do |meth| + clear + ) + wrap_methods << :repack if TDB.method_defined?(:repack) + wrap_methods.each do |meth| eval "def #{meth}(*args); @lock.synchronize { super }; end" end |