Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Simon Marchi <simon.marchi@polymtl.ca>
To: Tom Tromey <tom@tromey.com>
Cc: gdb-patches@sourceware.org
Subject: Re: [PATCH] gdb/testsuite: fix race condition in gdb.replay/missing-thread.c
Date: Fri, 20 Feb 2026 14:44:31 -0500	[thread overview]
Message-ID: <f782b96b-1dbe-4db6-af4b-cb77bebf5ffb@polymtl.ca> (raw)
In-Reply-To: <87cy1z1bhp.fsf@tromey.com>

On 2/20/26 2:05 PM, Tom Tromey wrote:
>>>>>> "Simon" == simon marchi <simon.marchi@polymtl.ca> writes:
> 
> Simon> Fix it by introducing a separate boolean predicate protected by the
> Simon> shared mutex, and looping until it is true.  This is the way
> Simon> pthread_cond_wait is meant to be used. From pthread_cond_wait(3):
> 
> Thanks.
> 
> Simon> +  pthread_mutex_lock (&g_mutex);
> Simon> +  g_ready = true;
> Simon> +  pthread_mutex_unlock (&g_mutex);
> Simon>    pthread_cond_signal (&g_condvar);
> 
> I looked into this and TIL it's fine to pthread_cond_signal without
> holding the lock.
> 
> Approved-By: Tom Tromey <tom@tromey.com>
> 
> Tom

Thanks, this will make my CI jobs much happier.  Pushed.

Simon

      reply	other threads:[~2026-02-20 19:45 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-02-06 17:57 simon.marchi
2026-02-20 15:24 ` Simon Marchi
2026-02-20 19:05 ` Tom Tromey
2026-02-20 19:44   ` Simon Marchi [this message]

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=f782b96b-1dbe-4db6-af4b-cb77bebf5ffb@polymtl.ca \
    --to=simon.marchi@polymtl.ca \
    --cc=gdb-patches@sourceware.org \
    --cc=tom@tromey.com \
    /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: link
Be 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