]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
[gdb/testsuite] Factor out proc lock_dir
authorTom de Vries <tdevries@suse.de>
Sat, 4 May 2024 08:41:09 +0000 (10:41 +0200)
committerTom de Vries <tdevries@suse.de>
Sat, 4 May 2024 08:41:09 +0000 (10:41 +0200)
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>
gdb/testsuite/lib/gdb-utils.exp
gdb/testsuite/lib/rocm.exp

index 4205f8d1a22725a0a12a28bac6c25453c6e72a92..c0b96d3c2bf06a3e3549e5c023215384e603e1f6 100644 (file)
@@ -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]
     }
 
index 7dd7ef3f3b55dfd2824cb5fa1e0cf18aeee3d8b8..2276bb3640ecd50a0cbd2766b5e36a5e167708ba 100644 (file)
@@ -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.