Fix compilation error on Windows (MSVC doesn't support m_AtExitFuncsSpinLock = ATOMIC_FLAG_INIT; in the class definition)

This commit is contained in:
Bertrand Bellenot 2015-05-18 11:36:52 +02:00 committed by sftnight
parent 1508b73c7c
commit 4d4a4b1270
2 changed files with 4 additions and 1 deletions

View File

@ -50,6 +50,9 @@ IncrementalExecutor::IncrementalExecutor(clang::DiagnosticsEngine& diags):
#endif
{
// MSVC doesn't support m_AtExitFuncsSpinLock=ATOMIC_FLAG_INIT; in the class definition
std::atomic_flag_clear( &m_AtExitFuncsSpinLock );
// No need to protect this access of m_AtExitFuncs, since nobody
// can use this object yet.
m_AtExitFuncs.reserve(256);

View File

@ -96,7 +96,7 @@ namespace cling {
/// and before the calling framework has any change of taking back/again
/// its lock protecting the access to cling, so we need to explicit protect
/// again multiple conccurent access.
std::atomic_flag m_AtExitFuncsSpinLock = ATOMIC_FLAG_INIT;
std::atomic_flag m_AtExitFuncsSpinLock; // MSVC doesn't support = ATOMIC_FLAG_INIT;
typedef llvm::SmallVector<CXAAtExitElement, 128> AtExitFunctions;
///\brief Static object, which are bound to unloading of certain declaration