[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: timeout: heads up: kFreeBSD's timers cause all timeout tests to hang
From: |
Jim Meyering |
Subject: |
Re: timeout: heads up: kFreeBSD's timers cause all timeout tests to hang |
Date: |
Thu, 22 Sep 2011 10:49:01 +0200 |
Pádraig Brady wrote:
> I can't think of anything better,
> so attached is a full patch for the above method.
That was a surprisingly tricky problem.
Thanks for dealing with it.
> I'd prefer to avoid timer_settime() if it creates a thread,
> but I don't know how to portably detect the presence of multiple threads.
> An alternative to ignore signals we send to our own group is
> attach a marker to the signal with sigqueue() and we
> could then discard all such signals. But that functionality
> is missing on many platforms and would complicate things anyway.
I like your solution.
Its apparent simplicity is deceptive.
Maybe add a NEWS entry?
> Subject: [PATCH] timeout: handle implicitly created threads
>
> On some systems like glibc on kFreeBSD, a thread is
> implicitly created when timer_settime() is used.
> This breaks our scheme to ignore signals we've
> sent ourselves.
>
> * src/timeout.c (send_sig): Change the scheme used to
> ignore signals we've sent ourselves, to a more robust
> but perhaps limited scheme of ignoring all signals of
> a certain type after we've sent that signal to the job.
> ---
> src/timeout.c | 20 +++++++++++---------
> 1 files changed, 11 insertions(+), 9 deletions(-)