[asterisk-dev] fork or pthread_atfork

Yuan Qin yuan007qin at gmail.com
Fri Apr 6 09:00:44 MST 2007


U are careless:), the ast_set_priority() also call some such functions.

On 4/6/07, Tilghman Lesher <tilghman at mail.jeffandtilghman.com> wrote:
>
> On Friday 06 April 2007, Yuan Qin wrote:
> > The ast_log() will lock a mutex if appropriate, but the mutex may be in
> > locked state already.
> > Maybe we should use pthread_atfork() instead of fork() or never call
> some
> > functions that hold mutex
> > before execv() in child process.
> >
> > Is there something that I missed?
>
> You missed the fact that the ast_log() only runs if the fork failed, which
> means it can NEVER happen in the child process, only in the parent (and
> only when there is no child).
>
> --
> Tilghman
> _______________________________________________
> --Bandwidth and Colocation provided by Easynews.com --
>
> asterisk-dev mailing list
> To UNSUBSCRIBE or update options visit:
>    http://lists.digium.com/mailman/listinfo/asterisk-dev
>



-- 
    Regards
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.digium.com/pipermail/asterisk-dev/attachments/20070406/ca7e9861/attachment.htm


More information about the asterisk-dev mailing list