From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2205) id 47591386F429; Sat, 4 May 2024 08:41:04 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 47591386F429 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1714812064; bh=E8vOy/goeWsYNd2gESUqhw3at+YD16MyHDx9vgaCmwY=; h=From:To:Subject:Date:From; b=GshQsAd2+GBFmE74xCvpcuC61X+ebPHiTUZj7lVSLPey7xhKMnGsavIAF42YdNEEw zxUpKQ+To+TDrEUB+fkEusIOpp+nQiXFasjl3Xj1ByXK4150drY0/tIpYPySp0UNkP UBx5pAV7HFxUIn5PP8Rxx930ORZg12fxs54pVnzM= Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable From: Tom de Vries To: gdb-cvs@sourceware.org Subject: [binutils-gdb] [gdb/testsuite] Factor out proc lock_dir X-Act-Checkin: binutils-gdb X-Git-Author: Tom de Vries X-Git-Refname: refs/heads/master X-Git-Oldrev: fbb0edfe60edf4ca01884151e6d9b1353aaa0a7e X-Git-Newrev: 007a7cb675ff2aa2a5f22fdcacf17553ee4ae427 Message-Id: <20240504084104.47591386F429@sourceware.org> Date: Sat, 4 May 2024 08:41:04 +0000 (GMT) List-Id: https://sourceware.org/git/gitweb.cgi?p=3Dbinutils-gdb.git;h=3D007a7cb675ff= 2aa2a5f22fdcacf17553ee4ae427 commit 007a7cb675ff2aa2a5f22fdcacf17553ee4ae427 Author: Tom de Vries Date: Sat May 4 10:41:09 2024 +0200 [gdb/testsuite] Factor out proc lock_dir =20 In lib/rocm.exp we have: ... set gpu_lock_filename $objdir/gpu-parallel.lock ... =20 This decides both the lock file name and directory. =20 Factor out a new proc lock_dir that decides on the directory, leaving j= ust: ... set gpu_lock_filename gpu-parallel.lock ... =20 Tested on aarch64-linux. =20 Approved-By: Tom Tromey Diff: --- gdb/testsuite/lib/gdb-utils.exp | 7 +++++++ gdb/testsuite/lib/rocm.exp | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/gdb/testsuite/lib/gdb-utils.exp b/gdb/testsuite/lib/gdb-utils.= exp index 4205f8d1a22..c0b96d3c2bf 100644 --- a/gdb/testsuite/lib/gdb-utils.exp +++ b/gdb/testsuite/lib/gdb-utils.exp @@ -177,10 +177,17 @@ proc lock_file_release {info} { } } =20 +# Return directory where we keep lock files. + +proc lock_dir {} { + return $objdir +} + # Run body under lock LOCK_FILE. =20 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] } =20 diff --git a/gdb/testsuite/lib/rocm.exp b/gdb/testsuite/lib/rocm.exp index 7dd7ef3f3b5..2276bb3640e 100644 --- a/gdb/testsuite/lib/rocm.exp +++ b/gdb/testsuite/lib/rocm.exp @@ -106,7 +106,7 @@ gdb_caching_proc allow_hipcc_tests {} { =20 # 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 =20 # Run body under the GPU lock. Also calls gdb_exit before releasing # the GPU lock.