Re: timing out on a semaphore

Arjan van de Ven
2001-02-26T14:34:41Z

In article <20010225224039.W13721@redhat.com> you wrote:

> --2F7AbV2suvT8PGoH
> Content-Type: text/plain; charset=us-ascii
> Content-Disposition: inline

> I'm trying to chase down a semaphore time-out problem. I want to
> sleep on a semaphore until either

> (a) it's signalled, or
> (b) some amount of time has elapsed.

> What I'm doing is calling add_timer, and then down_interruptible, and
> finally del_timer. The timer's function ups the semaphore.

What we _really_ need is down_timeout(), which I plan to implement for early
2.5. The semantics should by similar to the try_lock functions, exect that
it will try for a specified amount of time first.

Greetings,
Arjan van de Ven