[pjsip] pjsua callbacks

Benny Prijono bennylp at pjsip.org
Wed Feb 13 14:58:12 EST 2008


On 2/13/08, Norman Franke <norman at myasd.com> wrote:
>
> And, as I found out the hard way, you need to be very careful when calling
> PJ functions that will lock things you may not know about. This gets trick
> with callbacks, since they have already locked things, so locking an
> app-lock poses issues (e.g. your DB lock, though you probably shouldn't be
> calling DB functions from a callback.) A main thread function would want to
> lock the app lock, but when it calls various PJ functions, it can deadlock
> with your callback. I sort of get around this by trying to not call any PK
> functions if I have an app lock.

Ouch sorry to hear that, hopefully the article helps understanding how
locking works a bit.

FYI I've just added a section about (soft)deadlock in the article, to
make it more complete: http://trac.pjsip.org/repos/wiki/PJSUA_Locks

cheers,
 -benny




More information about the pjsip mailing list