[reSIProcate] [reSIProcate-commit] resiprocate 8871 sgodin: -fixed potential multi-threading issues with static member variable initialization

Kennard White kennard_white at logitech.com
Wed Dec 1 12:00:17 CST 2010


Hi Scott,

There is some intricacy of C++ that I don't understand. Could you explain
the thread safety issue below? Is there a difference in when the
constructors/destructors are called?

Thanks,
Kennard

+static const Data errorContextData("Contents");
 const Data&
 Contents::errorContext() const
 {
-   static const Data context("Contents");
-   return context;
+   return errorContextData;
 }


On Sat, Nov 27, 2010 at 7:37 AM, <svn at resiprocate.org> wrote:

>  Projectresiprocate New Revision8871<http://svn.resiprocate.org/viewsvn/resiprocate?view=rev&rev=8871>
> Committersgodin (Scott Godin) Date2010-11-27 09:37:49 -0600 (Sat, 27 Nov
> 2010) Log
>
>  -fixed potential multi-threading issues with static member variable initialization
>  -expose resip local logger id to applications
>
>
>
>
> Modified:
>
>    - main/resip/dum/UserProfile.cxx
>    <http://svn.resiprocate.org/viewsvn/resiprocate/main/resip/dum/UserProfile.cxx?r1=8870&r2=8871&diff_format=l>
>    - main/resip/stack/Contents.cxx
>    <http://svn.resiprocate.org/viewsvn/resiprocate/main/resip/stack/Contents.cxx?r1=8870&r2=8871&diff_format=l>
>    - main/resip/stack/DnsInterface.cxx
>    <http://svn.resiprocate.org/viewsvn/resiprocate/main/resip/stack/DnsInterface.cxx?r1=8870&r2=8871&diff_format=l>
>    - main/resip/stack/DnsResult.cxx
>    <http://svn.resiprocate.org/viewsvn/resiprocate/main/resip/stack/DnsResult.cxx?r1=8870&r2=8871&diff_format=l>
>    - main/resip/stack/SdpContents.cxx
>    <http://svn.resiprocate.org/viewsvn/resiprocate/main/resip/stack/SdpContents.cxx?r1=8870&r2=8871&diff_format=l>
>    - main/resip/stack/SipMessage.cxx
>    <http://svn.resiprocate.org/viewsvn/resiprocate/main/resip/stack/SipMessage.cxx?r1=8870&r2=8871&diff_format=l>
>    - main/resip/stack/Tuple.cxx
>    <http://svn.resiprocate.org/viewsvn/resiprocate/main/resip/stack/Tuple.cxx?r1=8870&r2=8871&diff_format=l>
>    - main/resip/stack/Uri.cxx
>    <http://svn.resiprocate.org/viewsvn/resiprocate/main/resip/stack/Uri.cxx?r1=8870&r2=8871&diff_format=l>
>    - main/resip/stack/XMLCursor.cxx
>    <http://svn.resiprocate.org/viewsvn/resiprocate/main/resip/stack/XMLCursor.cxx?r1=8870&r2=8871&diff_format=l>
>    - main/resip/stack/ssl/Security.cxx
>    <http://svn.resiprocate.org/viewsvn/resiprocate/main/resip/stack/ssl/Security.cxx?r1=8870&r2=8871&diff_format=l>
>    - main/resip/stack/ssl/WinSecurity.cxx
>    <http://svn.resiprocate.org/viewsvn/resiprocate/main/resip/stack/ssl/WinSecurity.cxx?r1=8870&r2=8871&diff_format=l>
>    - main/rutil/Log.hxx
>    <http://svn.resiprocate.org/viewsvn/resiprocate/main/rutil/Log.hxx?r1=8870&r2=8871&diff_format=l>
>
>
> _______________________________________________
> resiprocate-commit mailing list
> resiprocate-commit at resiprocate.org
> https://list.resiprocate.org/mailman/listinfo/resiprocate-commit
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://list.resiprocate.org/pipermail/resiprocate-devel/attachments/20101201/83c174be/attachment.htm>


More information about the resiprocate-devel mailing list