Re: [osol-code] timeout and mutexes

2007-05-30 Thread Paul Durrant
On 29/05/07, Garrett D'Amore <[EMAIL PROTECTED]> wrote: No, and I mis-stated the above restriction. The restriction should apply to mutexes held _across_ cv_wait. The mutex passed as an argument to cv_wait is dropped by cv_wait, and not held during the sleep call, so it can be acquired to do c

Re: [osol-code] timeout and mutexes

2007-05-29 Thread Garrett D'Amore
Paul Durrant wrote: On 28/05/07, Garrett D'Amore <[EMAIL PROTECTED]> wrote: You should not attempt to acquire a lock which will be held by other functions calling cv_wait, or its brethren. (There are ways to do that safely, but it requires a fair bit of effort to make sure you do it safely.)

Re: [osol-code] timeout and mutexes

2007-05-29 Thread Garrett D'Amore
Paul Durrant wrote: On 29/05/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: Paul Durrant wrote: > On 28/05/07, Garrett D'Amore <[EMAIL PROTECTED]> wrote: >> You should not attempt to acquire a lock which will be held by other >> functions calling cv_wait, or its brethren. (There are ways to d

Re: [osol-code] timeout and mutexes

2007-05-29 Thread [EMAIL PROTECTED]
Paul Durrant wrote: On 29/05/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: Paul Durrant wrote: > On 28/05/07, Garrett D'Amore <[EMAIL PROTECTED]> wrote: >> You should not attempt to acquire a lock which will be held by other >> functions calling cv_wait, or its brethren. (There are ways to d

Re: [osol-code] timeout and mutexes

2007-05-29 Thread Paul Durrant
On 29/05/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: Paul Durrant wrote: > On 28/05/07, Garrett D'Amore <[EMAIL PROTECTED]> wrote: >> You should not attempt to acquire a lock which will be held by other >> functions calling cv_wait, or its brethren. (There are ways to do that >> safely, but

Re: [osol-code] timeout and mutexes

2007-05-29 Thread [EMAIL PROTECTED]
Paul Durrant wrote: On 28/05/07, Garrett D'Amore <[EMAIL PROTECTED]> wrote: You should not attempt to acquire a lock which will be held by other functions calling cv_wait, or its brethren. (There are ways to do that safely, but it requires a fair bit of effort to make sure you do it safely.)

Re: [osol-code] timeout and mutexes

2007-05-29 Thread Paul Durrant
On 28/05/07, Garrett D'Amore <[EMAIL PROTECTED]> wrote: You should not attempt to acquire a lock which will be held by other functions calling cv_wait, or its brethren. (There are ways to do that safely, but it requires a fair bit of effort to make sure you do it safely.) I was not aware of t

Re: [osol-code] timeout and mutexes

2007-05-29 Thread Oliver Yang
[EMAIL PROTECTED] wrote: As my understand, cv_wait and its brethren could be called from a interrupt context, including a soft interrupt context. For this reason, when people read the timeout(9F), he will think since timeout handler's context is considered as a soft interrupt context, it wil

Re: [osol-code] timeout and mutexes

2007-05-29 Thread Casper . Dik
>As my understand, cv_wait and its brethren could be called from a >interrupt context, including a soft interrupt context. >For this reason, when people read the timeout(9F), he will think since >timeout handler's context is considered as a soft interrupt context, it >will be safe if we called

Re: [osol-code] timeout and mutexes

2007-05-29 Thread Oliver Yang
[EMAIL PROTECTED] wrote: Garrett D'Amore wrote: Thomas De Schampheleire wrote: Hi, The timeout(9F) manpage says: "The function called by timeout() must adhere to the same restrictions as a driver soft interrupt handler. The function called by timeout() is run in inter

Re: [osol-code] timeout and mutexes

2007-05-29 Thread Casper . Dik
>Garrett D'Amore wrote: >> Thomas De Schampheleire wrote: >>> Hi, >>> >>> The timeout(9F) manpage says: >>> >>> "The function called by timeout() must adhere to the same >>> restrictions as a driver soft interrupt handler. >>> >>> The function called by timeout() is run in interrupt co

Re: [osol-code] timeout and mutexes

2007-05-28 Thread Oliver Yang
Garrett D'Amore wrote: Oliver Yang wrote: Garrett D'Amore wrote: Thomas De Schampheleire wrote: Hi, The timeout(9F) manpage says: "The function called by timeout() must adhere to the same restrictions as a driver soft interrupt handler. The function called by timeout() is run in

Re: [osol-code] timeout and mutexes

2007-05-28 Thread Garrett D'Amore
Oliver Yang wrote: Garrett D'Amore wrote: Thomas De Schampheleire wrote: Hi, The timeout(9F) manpage says: "The function called by timeout() must adhere to the same restrictions as a driver soft interrupt handler. The function called by timeout() is run in interrupt context a

Re: [osol-code] timeout and mutexes

2007-05-28 Thread Oliver Yang
Garrett D'Amore wrote: Thomas De Schampheleire wrote: Hi, The timeout(9F) manpage says: "The function called by timeout() must adhere to the same restrictions as a driver soft interrupt handler. The function called by timeout() is run in interrupt context and must not sleep or

Re: [osol-code] timeout and mutexes

2007-05-28 Thread Garrett D'Amore
Thomas De Schampheleire wrote: Hi, The timeout(9F) manpage says: "The function called by timeout() must adhere to the same restrictions as a driver soft interrupt handler. The function called by timeout() is run in interrupt context and must not sleep or call other functions th

Re: [osol-code] timeout and mutexes

2007-05-28 Thread Casper . Dik
>Hi, > >The timeout(9F) manpage says: > >"The function called by timeout() must adhere to the same > restrictions as a driver soft interrupt handler. > > The function called by timeout() is run in interrupt context > and must not sleep or call other functions that might sleep." > >

[osol-code] timeout and mutexes

2007-05-28 Thread Thomas De Schampheleire
Hi, The timeout(9F) manpage says: "The function called by timeout() must adhere to the same restrictions as a driver soft interrupt handler. The function called by timeout() is run in interrupt context and must not sleep or call other functions that might sleep." Does this mean