Fw: [Boost-users] Problem with shared_ptr and pthreads_mutex_lock

Paolo Carlini pcarlini@suse.de
Thu Oct 6 22:16:00 GMT 2005


Paolo Carlini wrote:

> Kurt Kohler wrote:
>
>> I should emphasize that this isn't just a problem with what valgrind
>> reports.
>
> In fact, I'm seeing something fishy in the usage of _M_mutex (i.e.,
> its initialization) in our code for shared_ptr. I will try to tell you
> more as soon as possible.

Indeed, the mutex is not initialized at all. The below is a possible,
minimal, fix (for sure we are a long way from a well tested and
optimized implementation). Can you test it (*) with your application??

Thanks,
Paolo.

(*) Just in case: given the structure of the library, rebuilding
compiler and library is not necessary, simply patching the concerned
header file in its installation place will do.

///////////////
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: p24244.diff
URL: <http://gcc.gnu.org/pipermail/libstdc++/attachments/20051006/7eb57ef1/attachment.ksh>


More information about the Libstdc++ mailing list