aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom de Vries <tdevries@suse.de>2024-05-04 10:41:09 +0200
committerTom de Vries <tdevries@suse.de>2024-05-04 10:41:09 +0200
commit007a7cb675ff2aa2a5f22fdcacf17553ee4ae427 (patch)
treefba5a60597e90ff8260ec45516939b9dc2f329f1
parentfbb0edfe60edf4ca01884151e6d9b1353aaa0a7e (diff)
downloadbinutils-007a7cb675ff2aa2a5f22fdcacf17553ee4ae427.zip
binutils-007a7cb675ff2aa2a5f22fdcacf17553ee4ae427.tar.gz
binutils-007a7cb675ff2aa2a5f22fdcacf17553ee4ae427.tar.bz2
[gdb/testsuite] Factor out proc lock_dir
In lib/rocm.exp we have: ... set gpu_lock_filename $objdir/gpu-parallel.lock ... This decides both the lock file name and directory. Factor out a new proc lock_dir that decides on the directory, leaving just: ... set gpu_lock_filename gpu-parallel.lock ... Tested on aarch64-linux. Approved-By: Tom Tromey <tom@tromey.com>
-rw-r--r--gdb/testsuite/lib/gdb-utils.exp7
-rw-r--r--gdb/testsuite/lib/rocm.exp2
2 files changed, 8 insertions, 1 deletions
diff --git a/gdb/testsuite/lib/gdb-utils.exp b/gdb/testsuite/lib/gdb-utils.exp
index 4205f8d..c0b96d3 100644
--- a/gdb/testsuite/lib/gdb-utils.exp
+++ b/gdb/testsuite/lib/gdb-utils.exp
@@ -177,10 +177,17 @@ proc lock_file_release {info} {
}
}
+# Return directory where we keep lock files.
+
+proc lock_dir {} {
+ return $objdir
+}
+
# Run body under lock LOCK_FILE.
proc with_lock { lock_file body } {
if {[info exists ::GDB_PARALLEL]} {
+ set lock_file [file join [lock_dir] $lock_file]
set lock_rc [lock_file_acquire $lock_file]
}
diff --git a/gdb/testsuite/lib/rocm.exp b/gdb/testsuite/lib/rocm.exp
index 7dd7ef3..2276bb3 100644
--- a/gdb/testsuite/lib/rocm.exp
+++ b/gdb/testsuite/lib/rocm.exp
@@ -106,7 +106,7 @@ gdb_caching_proc allow_hipcc_tests {} {
# The lock file used to ensure that only one GDB has access to the GPU
# at a time.
-set gpu_lock_filename $objdir/gpu-parallel.lock
+set gpu_lock_filename gpu-parallel.lock
# Run body under the GPU lock. Also calls gdb_exit before releasing
# the GPU lock.