Commit 8c61f400 by Paolo Carlini Committed by Paolo Carlini

ios_init.cc (ios_base::Init::~Init): Add back semicolon at the end of the…

ios_init.cc (ios_base::Init::~Init): Add back semicolon at the end of the _GLIBCXX_SYNCHRONIZATION_HAPPENS* macros...

2010-08-12  Paolo Carlini  <paolo.carlini@oracle.com>

	* src/ios_init.cc (ios_base::Init::~Init): Add back semicolon
	at the end of the _GLIBCXX_SYNCHRONIZATION_HAPPENS* macros,
	removed by mistake.
	* include/tr1_impl/boost_sp_counted_base.h: Likewise.
	* include/ext/rc_string_base.h: Likewise.
	* include/bits/locale_classes.h: Likewise.
	* include/bits/basic_string.h: Likewise.
	* include/bits/ios_base.h: Likewise.
	* include/bits/c++config: Adjust comment.

From-SVN: r163223
parent ec760bea
2010-08-13 Paolo Carlini <paolo.carlini@oracle.com>
* src/ios_init.cc (ios_base::Init::~Init): Add back semicolon
at the end of the _GLIBCXX_SYNCHRONIZATION_HAPPENS_* macros,
removed by mistake.
* include/tr1_impl/boost_sp_counted_base.h: Likewise.
* include/ext/rc_string_base.h: Likewise.
* include/bits/locale_classes.h: Likewise.
* include/bits/basic_string.h: Likewise.
* include/bits/ios_base.h: Likewise.
* include/bits/c++config: Adjust comment.
2010-08-12 Kostya Serebryany <kcc@google.com> 2010-08-12 Kostya Serebryany <kcc@google.com>
Paolo Carlini <paolo.carlini@oracle.com> Paolo Carlini <paolo.carlini@oracle.com>
......
...@@ -234,11 +234,11 @@ _GLIBCXX_BEGIN_NAMESPACE(std) ...@@ -234,11 +234,11 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
#endif #endif
{ {
// Be race-detector-friendly. For more info see bits/c++config. // Be race-detector-friendly. For more info see bits/c++config.
_GLIBCXX_SYNCHRONIZATION_HAPPENS_BEFORE(&this->_M_refcount) _GLIBCXX_SYNCHRONIZATION_HAPPENS_BEFORE(&this->_M_refcount);
if (__gnu_cxx::__exchange_and_add_dispatch(&this->_M_refcount, if (__gnu_cxx::__exchange_and_add_dispatch(&this->_M_refcount,
-1) <= 0) -1) <= 0)
{ {
_GLIBCXX_SYNCHRONIZATION_HAPPENS_AFTER(&this->_M_refcount) _GLIBCXX_SYNCHRONIZATION_HAPPENS_AFTER(&this->_M_refcount);
_M_destroy(__a); _M_destroy(__a);
} }
} }
......
...@@ -71,10 +71,10 @@ ...@@ -71,10 +71,10 @@
// current implementation of the library) is atomic reference counting: // current implementation of the library) is atomic reference counting:
// void _M_remove_reference() // void _M_remove_reference()
// { // {
// _GLIBCXX_SYNCHRONIZATION_HAPPENS_BEFORE(&this->_M_refcount) // _GLIBCXX_SYNCHRONIZATION_HAPPENS_BEFORE(&this->_M_refcount);
// if (__gnu_cxx::__exchange_and_add_dispatch(&this->_M_refcount, -1) <= 0) // if (__gnu_cxx::__exchange_and_add_dispatch(&this->_M_refcount, -1) <= 0)
// { // {
// _GLIBCXX_SYNCHRONIZATION_HAPPENS_AFTER(&this->_M_refcount) // _GLIBCXX_SYNCHRONIZATION_HAPPENS_AFTER(&this->_M_refcount);
// _M_destroy(__a); // _M_destroy(__a);
// } // }
// } // }
......
...@@ -476,11 +476,11 @@ _GLIBCXX_BEGIN_NAMESPACE(std) ...@@ -476,11 +476,11 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
_M_remove_reference() _M_remove_reference()
{ {
// Be race-detector-friendly. For more info see bits/c++config. // Be race-detector-friendly. For more info see bits/c++config.
_GLIBCXX_SYNCHRONIZATION_HAPPENS_BEFORE(&_M_refcount) _GLIBCXX_SYNCHRONIZATION_HAPPENS_BEFORE(&_M_refcount);
int __res = __gnu_cxx::__exchange_and_add_dispatch(&_M_refcount, -1); int __res = __gnu_cxx::__exchange_and_add_dispatch(&_M_refcount, -1);
if (__res == 0) if (__res == 0)
{ {
_GLIBCXX_SYNCHRONIZATION_HAPPENS_AFTER(&_M_refcount) _GLIBCXX_SYNCHRONIZATION_HAPPENS_AFTER(&_M_refcount);
} }
return __res; return __res;
} }
......
...@@ -403,10 +403,10 @@ _GLIBCXX_BEGIN_NAMESPACE(std) ...@@ -403,10 +403,10 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
_M_remove_reference() const throw() _M_remove_reference() const throw()
{ {
// Be race-detector-friendly. For more info see bits/c++config. // Be race-detector-friendly. For more info see bits/c++config.
_GLIBCXX_SYNCHRONIZATION_HAPPENS_BEFORE(&_M_refcount) _GLIBCXX_SYNCHRONIZATION_HAPPENS_BEFORE(&_M_refcount);
if (__gnu_cxx::__exchange_and_add_dispatch(&_M_refcount, -1) == 1) if (__gnu_cxx::__exchange_and_add_dispatch(&_M_refcount, -1) == 1)
{ {
_GLIBCXX_SYNCHRONIZATION_HAPPENS_AFTER(&_M_refcount) _GLIBCXX_SYNCHRONIZATION_HAPPENS_AFTER(&_M_refcount);
__try __try
{ delete this; } { delete this; }
__catch(...) __catch(...)
...@@ -512,10 +512,10 @@ _GLIBCXX_BEGIN_NAMESPACE(std) ...@@ -512,10 +512,10 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
_M_remove_reference() throw() _M_remove_reference() throw()
{ {
// Be race-detector-friendly. For more info see bits/c++config. // Be race-detector-friendly. For more info see bits/c++config.
_GLIBCXX_SYNCHRONIZATION_HAPPENS_BEFORE(&_M_refcount) _GLIBCXX_SYNCHRONIZATION_HAPPENS_BEFORE(&_M_refcount);
if (__gnu_cxx::__exchange_and_add_dispatch(&_M_refcount, -1) == 1) if (__gnu_cxx::__exchange_and_add_dispatch(&_M_refcount, -1) == 1)
{ {
_GLIBCXX_SYNCHRONIZATION_HAPPENS_AFTER(&_M_refcount) _GLIBCXX_SYNCHRONIZATION_HAPPENS_AFTER(&_M_refcount);
__try __try
{ delete this; } { delete this; }
__catch(...) __catch(...)
......
...@@ -201,12 +201,12 @@ _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx) ...@@ -201,12 +201,12 @@ _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx)
{ {
// Be race-detector-friendly. For more info see bits/c++config. // Be race-detector-friendly. For more info see bits/c++config.
_GLIBCXX_SYNCHRONIZATION_HAPPENS_BEFORE(&_M_rep()->_M_info. _GLIBCXX_SYNCHRONIZATION_HAPPENS_BEFORE(&_M_rep()->_M_info.
_M_refcount) _M_refcount);
if (__exchange_and_add_dispatch(&_M_rep()->_M_info._M_refcount, if (__exchange_and_add_dispatch(&_M_rep()->_M_info._M_refcount,
-1) <= 0) -1) <= 0)
{ {
_GLIBCXX_SYNCHRONIZATION_HAPPENS_AFTER(&_M_rep()->_M_info. _GLIBCXX_SYNCHRONIZATION_HAPPENS_AFTER(&_M_rep()->_M_info.
_M_refcount) _M_refcount);
_M_rep()->_M_destroy(_M_get_allocator()); _M_rep()->_M_destroy(_M_get_allocator());
} }
} // XXX MT } // XXX MT
......
...@@ -140,10 +140,10 @@ _GLIBCXX_BEGIN_NAMESPACE_TR1 ...@@ -140,10 +140,10 @@ _GLIBCXX_BEGIN_NAMESPACE_TR1
_M_release() // nothrow _M_release() // nothrow
{ {
// Be race-detector-friendly. For more info see bits/c++config. // Be race-detector-friendly. For more info see bits/c++config.
_GLIBCXX_SYNCHRONIZATION_HAPPENS_BEFORE(&_M_use_count) _GLIBCXX_SYNCHRONIZATION_HAPPENS_BEFORE(&_M_use_count);
if (__gnu_cxx::__exchange_and_add_dispatch(&_M_use_count, -1) == 1) if (__gnu_cxx::__exchange_and_add_dispatch(&_M_use_count, -1) == 1)
{ {
_GLIBCXX_SYNCHRONIZATION_HAPPENS_AFTER(&_M_use_count) _GLIBCXX_SYNCHRONIZATION_HAPPENS_AFTER(&_M_use_count);
_M_dispose(); _M_dispose();
// There must be a memory barrier between dispose() and destroy() // There must be a memory barrier between dispose() and destroy()
// to ensure that the effects of dispose() are observed in the // to ensure that the effects of dispose() are observed in the
...@@ -156,11 +156,11 @@ _GLIBCXX_BEGIN_NAMESPACE_TR1 ...@@ -156,11 +156,11 @@ _GLIBCXX_BEGIN_NAMESPACE_TR1
} }
// Be race-detector-friendly. For more info see bits/c++config. // Be race-detector-friendly. For more info see bits/c++config.
_GLIBCXX_SYNCHRONIZATION_HAPPENS_BEFORE(&_M_weak_count) _GLIBCXX_SYNCHRONIZATION_HAPPENS_BEFORE(&_M_weak_count);
if (__gnu_cxx::__exchange_and_add_dispatch(&_M_weak_count, if (__gnu_cxx::__exchange_and_add_dispatch(&_M_weak_count,
-1) == 1) -1) == 1)
{ {
_GLIBCXX_SYNCHRONIZATION_HAPPENS_AFTER(&_M_weak_count) _GLIBCXX_SYNCHRONIZATION_HAPPENS_AFTER(&_M_weak_count);
_M_destroy(); _M_destroy();
} }
} }
...@@ -174,10 +174,10 @@ _GLIBCXX_BEGIN_NAMESPACE_TR1 ...@@ -174,10 +174,10 @@ _GLIBCXX_BEGIN_NAMESPACE_TR1
_M_weak_release() // nothrow _M_weak_release() // nothrow
{ {
// Be race-detector-friendly. For more info see bits/c++config. // Be race-detector-friendly. For more info see bits/c++config.
_GLIBCXX_SYNCHRONIZATION_HAPPENS_BEFORE(&_M_weak_count) _GLIBCXX_SYNCHRONIZATION_HAPPENS_BEFORE(&_M_weak_count);
if (__gnu_cxx::__exchange_and_add_dispatch(&_M_weak_count, -1) == 1) if (__gnu_cxx::__exchange_and_add_dispatch(&_M_weak_count, -1) == 1)
{ {
_GLIBCXX_SYNCHRONIZATION_HAPPENS_AFTER(&_M_weak_count) _GLIBCXX_SYNCHRONIZATION_HAPPENS_AFTER(&_M_weak_count);
if (_Mutex_base<_Lp>::_S_need_barriers) if (_Mutex_base<_Lp>::_S_need_barriers)
{ {
// See _M_release(), // See _M_release(),
......
...@@ -123,10 +123,10 @@ _GLIBCXX_BEGIN_NAMESPACE(std) ...@@ -123,10 +123,10 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
ios_base::Init::~Init() ios_base::Init::~Init()
{ {
// Be race-detector-friendly. For more info see bits/c++config. // Be race-detector-friendly. For more info see bits/c++config.
_GLIBCXX_SYNCHRONIZATION_HAPPENS_BEFORE(&_S_refcount) _GLIBCXX_SYNCHRONIZATION_HAPPENS_BEFORE(&_S_refcount);
if (__gnu_cxx::__exchange_and_add_dispatch(&_S_refcount, -1) == 2) if (__gnu_cxx::__exchange_and_add_dispatch(&_S_refcount, -1) == 2)
{ {
_GLIBCXX_SYNCHRONIZATION_HAPPENS_AFTER(&_S_refcount) _GLIBCXX_SYNCHRONIZATION_HAPPENS_AFTER(&_S_refcount);
// Catch any exceptions thrown by basic_ostream::flush() // Catch any exceptions thrown by basic_ostream::flush()
__try __try
{ {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment