public inbox for gdb-cvs@sourceware.org help / color / mirror / Atom feed
From: Tom de Vries <vries@sourceware.org> To: gdb-cvs@sourceware.org Subject: [binutils-gdb] [gdb/testsuite] Factor out proc lock_dir Date: Sat, 4 May 2024 08:41:04 +0000 (GMT) [thread overview] Message-ID: <20240504084104.47591386F429@sourceware.org> (raw) https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=007a7cb675ff2aa2a5f22fdcacf17553ee4ae427 commit 007a7cb675ff2aa2a5f22fdcacf17553ee4ae427 Author: Tom de Vries <tdevries@suse.de> Date: Sat May 4 10:41:09 2024 +0200 [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> 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} { } } +# 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 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 {} { # 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.
reply other threads:[~2024-05-04 8:41 UTC|newest] Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20240504084104.47591386F429@sourceware.org \ --to=vries@sourceware.org \ --cc=gdb-cvs@sourceware.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).