Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Pedro Alves <pedro@palves.net>
To: Tom de Vries <tdevries@suse.de>, gdb-patches@sourceware.org
Subject: Re: [PATCH] [gdb/tdep] Don't call WaitForSingleObject with INFINITE arg
Date: Thu, 5 Jun 2025 17:25:58 +0100	[thread overview]
Message-ID: <e9834f19-410a-4c58-8b90-04410c096a5f@palves.net> (raw)
In-Reply-To: <a6a1fb8b-4a4b-4fc0-a983-bc8d6cea5af8@palves.net>

On 2025-06-05 17:15, Pedro Alves wrote:
> On 2025-06-05 16:03, Tom de Vries wrote:

>> Fix this by avoiding calling WaitForSingleObject with INFINITE argument.
> 
> Approved-By: Pedro Alves <pedro@palves.net>
> 

Actually, can you add a comment to the code, please, explaining why we're avoiding INFINITE?

LGTM with that.  :-)

On 2025-06-05 16:03, Tom de Vries wrote:
>    while (true)
>      {
> -      DWORD r = WaitForSingleObject (handle, howlong);
> +      DWORD milliseconds = howlong == INFINITE ? 100 : howlong;
> +      DWORD r = WaitForSingleObject (handle, milliseconds);
> +      if (howlong == INFINITE && r == WAIT_TIMEOUT)
> +	continue;
>        if (r == WAIT_OBJECT_0)
>  	return;

  reply	other threads:[~2025-06-05 16:26 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-06-05 15:03 Tom de Vries
2025-06-05 16:15 ` Pedro Alves
2025-06-05 16:25   ` Pedro Alves [this message]
2025-06-06  6:27     ` Tom de Vries
2025-06-06  7:12   ` Tom de Vries
2025-06-06 15:14     ` Pedro Alves
2025-06-06 15:27       ` Pedro Alves
2025-06-09 17:52         ` Pedro Alves
2025-06-10  7:13           ` Tom de Vries
2025-06-06 13:11   ` Pedro Alves
2025-06-10  7:13     ` Tom de Vries
2025-06-10  9:51       ` Pedro Alves

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=e9834f19-410a-4c58-8b90-04410c096a5f@palves.net \
    --to=pedro@palves.net \
    --cc=gdb-patches@sourceware.org \
    --cc=tdevries@suse.de \
    /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