|
Boost Users : |
Subject: Re: [Boost-users] weak_ptr::lock is not thread safe
From: Dmytro Ovdiienko (dmitriy.ovdienko_at_[hidden])
Date: 2010-12-16 13:19:00
Frank,
Thanks.
My program sometimes generates segfault. Looks like problem is not in the
boost :-\
On 16 December 2010 18:26, Frank Mori Hess <frank.hess_at_[hidden]> wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> On Thursday 16 December 2010, Dmytro Ovdiienko wrote:
> > I've just realized weak_ptr::lock is not thread safe. Is it expected
> > behavior? Following sample reproduced this conclusion.
>
> It is thread safe. Your code appears to have a race in it between
> destroying the shared_ptr and locking the weak_ptr.
>
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.9 (GNU/Linux)
>
> iEYEARECAAYFAk0KPcEACgkQ5vihyNWuA4WVkACeIk8QpbEhF5/k5szY2o6rJ7Ep
> gHgAoOVPbV/uBAsZTWWjqrwClK6ITZeK
> =6DeE
> -----END PGP SIGNATURE-----
> _______________________________________________
> Boost-users mailing list
> Boost-users_at_[hidden]
> http://lists.boost.org/mailman/listinfo.cgi/boost-users
>
-- Dmytro Ovdiienko e-mail: dmitriy.ovdienko_at_[hidden] skype: dmitriy.ovdienko_at_[hidden] mobile: +38050-1909731
Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net