summaryrefslogtreecommitdiff
path: root/db-4.8.30/test/mut002script.tcl
diff options
context:
space:
mode:
authorJesse Morgan <jesse@jesterpm.net>2016-12-17 21:28:53 -0800
committerJesse Morgan <jesse@jesterpm.net>2016-12-17 21:28:53 -0800
commit54df2afaa61c6a03cbb4a33c9b90fa572b6d07b8 (patch)
tree18147b92b969d25ffbe61935fb63035cac820dd0 /db-4.8.30/test/mut002script.tcl
Berkeley DB 4.8 with rust build script for linux.
Diffstat (limited to 'db-4.8.30/test/mut002script.tcl')
-rw-r--r--db-4.8.30/test/mut002script.tcl39
1 files changed, 39 insertions, 0 deletions
diff --git a/db-4.8.30/test/mut002script.tcl b/db-4.8.30/test/mut002script.tcl
new file mode 100644
index 0000000..7f340f5
--- /dev/null
+++ b/db-4.8.30/test/mut002script.tcl
@@ -0,0 +1,39 @@
+# See the file LICENSE for redistribution information.
+#
+# Copyright (c) 2009 Oracle. All rights reserved.
+#
+# $Id$
+#
+# Mut002script: for use with mut002, a 2-process mutex test.
+# Usage: mut002script testdir
+# testdir: directory containing the env we are joining.
+# mutex: id of mutex
+
+source ./include.tcl
+
+set usage "mut002script testdir mutex"
+
+# Verify usage
+if { $argc != 2 } {
+ puts stderr "FAIL:[timestamp] Usage: $usage"
+ exit
+}
+
+# Initialize arguments.
+set testdir [ lindex $argv 0 ]
+set mutex [ lindex $argv 1 ]
+
+# Open environment.
+if {[catch {eval {berkdb_env} -create -home $testdir } dbenv]} {
+ puts "FAIL: opening env returned $dbenv"
+}
+error_check_good envopen [is_valid_env $dbenv] TRUE
+
+# Pause for a while to let the original process block.
+tclsleep 10
+
+# Unlock the mutex and let the original process proceed.
+$dbenv mutex_unlock $mutex
+
+# Clean up.
+error_check_good env_close [$dbenv close] 0