boost_shared_ptr.h (_Sp_counted_base::release): Optimize by manually inlining weak_release.
2005-11-10 Paolo Carlini <pcarlini@suse.de> Peter Dimov <pdimov@mmltd.net> * include/tr1/boost_shared_ptr.h (_Sp_counted_base::release): Optimize by manually inlining weak_release. * include/tr1/boost_shared_ptr.h (_Sp_counted_base::release, weak_release): Use explicit memory barriers. Co-Authored-By: Peter Dimov <pdimov@mmltd.net> From-SVN: r106729
This commit is contained in:
parent
720e2f72c3
commit
7fd6021841
|
@ -1,3 +1,12 @@
|
|||
2005-11-10 Paolo Carlini <pcarlini@suse.de>
|
||||
Peter Dimov <pdimov@mmltd.net>
|
||||
|
||||
* include/tr1/boost_shared_ptr.h (_Sp_counted_base::release):
|
||||
Optimize by manually inlining weak_release.
|
||||
|
||||
* include/tr1/boost_shared_ptr.h (_Sp_counted_base::release,
|
||||
weak_release): Use explicit memory barriers.
|
||||
|
||||
2005-11-09 Benjamin Kosnik <bkoz@redhat.com>
|
||||
Paolo Carlini <pcarlini@suse.de>
|
||||
Gabriel Dos Reis <gdr@integrable-solutions.net>
|
||||
|
|
|
@ -151,9 +151,12 @@ public:
|
|||
if (__gnu_cxx::__exchange_and_add(&_M_use_count, -1) == 1)
|
||||
{
|
||||
dispose();
|
||||
__glibcxx_mutex_lock(_M_mutex);
|
||||
__glibcxx_mutex_unlock(_M_mutex);
|
||||
weak_release();
|
||||
|
||||
_GLIBCXX_READ_MEM_BARRIER;
|
||||
_GLIBCXX_WRITE_MEM_BARRIER;
|
||||
|
||||
if (__gnu_cxx::__exchange_and_add(&_M_weak_count, -1) == 1)
|
||||
destroy();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -168,8 +171,8 @@ public:
|
|||
{
|
||||
if (__gnu_cxx::__exchange_and_add(&_M_weak_count, -1) == 1)
|
||||
{
|
||||
__glibcxx_mutex_lock(_M_mutex);
|
||||
__glibcxx_mutex_unlock(_M_mutex);
|
||||
_GLIBCXX_READ_MEM_BARRIER;
|
||||
_GLIBCXX_WRITE_MEM_BARRIER;
|
||||
destroy();
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue