[pjsip] Client registration layer locking

Philippe philippe.leuba at eyepmedia.com
Mon Nov 19 08:47:44 EST 2007

Hi Benny,

I agree with you that only one transaction could run at a given time;
however some variables (such as timer or has_tsx) of the regc structure can
be tested or changed from the APIS calls.

Best regards

Philippe Leuba

-----Original Message-----
From: pjsip-bounces at lists.pjsip.org [mailto:pjsip-bounces at lists.pjsip.org]
On Behalf Of Benny Prijono
Sent: vendredi, 16. novembre 2007 09:03
To: pjsip embedded/DSP SIP discussion
Subject: Re: [pjsip] Client registration layer locking

Hi Philippe,

the lack of mutex protection in regc was pretty much intentional, as 
once the regc is created, all updates to the structure will be done 
from the transaction callback. And since regc does not allow more 
than one transactions to run at the same time, we should be safe. 
Well at least that's the way it was supposed to work.


Philippe wrote:
> Hi,
> By examining the pjsip-ua layer providing the client registration 
> (regc), we notice that no locking mechanism is used.
> It seems that this can cause some potential risks if we are using worker 
> threads as the reception callback or the timer can access the regc 
> structure at the same time that the regc APIs.
> Other layers, such as the invite or xfer use the lock of the underlying 
> dialog.
> Philippe Leuba
> eyeP Media SA

Visit our blog: http://blog.pjsip.org

pjsip mailing list
pjsip at lists.pjsip.org

More information about the pjsip mailing list