stdcxx-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From far...@apache.org
Subject svn commit: r644662 - /stdcxx/trunk/src/once.cpp
Date Fri, 04 Apr 2008 09:51:00 GMT
Author: faridz
Date: Fri Apr  4 02:50:57 2008
New Revision: 644662

URL: http://svn.apache.org/viewvc?rev=644662&view=rev
Log:
2008-04-04  Farid Zaripov  <farid_zaripov@epam.com>

	* src/once.cpp (__rw_once): Cast init to int& to avoid using mutex
	version of __rw_atomic_preincrement() when atomic version is present.

Modified:
    stdcxx/trunk/src/once.cpp

Modified: stdcxx/trunk/src/once.cpp
URL: http://svn.apache.org/viewvc/stdcxx/trunk/src/once.cpp?rev=644662&r1=644661&r2=644662&view=diff
==============================================================================
--- stdcxx/trunk/src/once.cpp (original)
+++ stdcxx/trunk/src/once.cpp Fri Apr  4 02:50:57 2008
@@ -120,7 +120,10 @@
 
 restart:
 
-    if (init == 0 && 1 == _RWSTD_ATOMIC_PREINCREMENT (init, false)) {
+    // cast init to int& (see STDCXX-792)
+    // casting should be removed after fixing STDCXX-794
+    if (init == 0 && 1 == _RWSTD_ATOMIC_PREINCREMENT (
+            _RWSTD_CONST_CAST (int&, init), false)) {
 
         // entered by the first thread and only the first time around,
         // unless the initialization function throws



Mime
View raw message