Re: [PATCH] [gdb/tdep] Don't call WaitForSingleObject with INFINITE arg

Pedro Alves
2025-06-05T16:26:46Z

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;