[asterisk-dev] fork or pthread_atfork

Tilghman Lesher tilghman at mail.jeffandtilghman.com
Sun Apr 8 09:06:05 MST 2007


On Friday 06 April 2007, Kevin P. Fleming wrote:
> Yuan Qin wrote:
> > The ast_log() will lock a mutex if appropriate, but the mutex may be in
> > locked state already.
>
> However, you have raised a very valid point... we cannot use
> pthread-related functions for synchronization after forking, because we
> are not running in the same process any longer. I will have someone look
> into this, thanks for raising the issue!

I've been looking at the manpages for the scheduling calls, and based upon the
documentation therein, I have to conclude that the call to setpriority can
never fail when lowering the priority, which makes the error checking
superfluous.  The error checks could probably be removed, just as we've
removed error checking for ast_strdupa() and alloca() (because they similarly
can never fail).

-- 
Tilghman


More information about the asterisk-dev mailing list