Re: stopping callouts

2007-06-05 Thread John Baldwin
On Monday 04 June 2007 05:39:32 am Artis Caune wrote: > Sam Leffler wrote: > > > > If you use callout_init_mtx then use callout_stop while holding my_mtx; > > if the callout is blocked waiting for my_mtx the request will be discarded. > > > > callout_drain should not be called while holding my_

Re: stopping callouts

2007-06-04 Thread Artis Caune
Sam Leffler wrote: If you use callout_init_mtx then use callout_stop while holding my_mtx; if the callout is blocked waiting for my_mtx the request will be discarded. callout_drain should not be called while holding my_mtx because it can sleep. Thanks, than I will use: MTX_LOCK; ... c

Re: stopping callouts

2007-06-01 Thread Sam Leffler
Artis Caune wrote: Hello FreeBSD-hackers! what is the right way to stop callout which is initialized with mutex: callout_init_mtx(&callout_function, &my_mtx, 0); should I lock mutex before calling callout_drain() or not? man page says: callout_drain() is identical to callout_stop() and if th

Re: stopping callouts

2007-06-01 Thread Hans Petter Selasky
On Friday 01 June 2007 12:19, Artis Caune wrote: > Hello FreeBSD-hackers! > > what is the right way to stop callout which is initialized with mutex: >callout_init_mtx(&callout_function, &my_mtx, 0); > > should I lock mutex before calling callout_drain() or not? > > man page says: callout_drain(

stopping callouts

2007-06-01 Thread Artis Caune
Hello FreeBSD-hackers! what is the right way to stop callout which is initialized with mutex: callout_init_mtx(&callout_function, &my_mtx, 0); should I lock mutex before calling callout_drain() or not? man page says: callout_drain() is identical to callout_stop() and if the callout has an ass