diff options
author | Marshall Clow <mclow.lists@gmail.com> | 2013-10-12 19:13:52 +0000 |
---|---|---|
committer | Marshall Clow <mclow.lists@gmail.com> | 2013-10-12 19:13:52 +0000 |
commit | f28fd284f86b621fd721ac455d98feb9b349ec16 (patch) | |
tree | 4f33623f933a4165915f6ca78177d3eb6de66d3a /libcxx/src | |
parent | 8de32cb3dc3b42783db69335db4a9ccc94ec58f7 (diff) | |
download | bcm5719-llvm-f28fd284f86b621fd721ac455d98feb9b349ec16.tar.gz bcm5719-llvm-f28fd284f86b621fd721ac455d98feb9b349ec16.zip |
LWG issue 2143: ios_base::xalloc should be thread-safe
llvm-svn: 192539
Diffstat (limited to 'libcxx/src')
-rw-r--r-- | libcxx/src/ios.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/libcxx/src/ios.cpp b/libcxx/src/ios.cpp index 754c2c95682..e79b3284cc2 100644 --- a/libcxx/src/ios.cpp +++ b/libcxx/src/ios.cpp @@ -149,8 +149,11 @@ ios_base::getloc() const } // xalloc - +#if __has_feature(cxx_atomic) +atomic<int> ios_base::__xindex_ = ATOMIC_VAR_INIT(0); +#else int ios_base::__xindex_ = 0; +#endif int ios_base::xalloc() |