refs #495 Workaround lack of atomic operations on std::shared_ptr in GCC 4.9.

This commit is contained in:
Mathew Sutcliffe
2015-11-01 23:28:24 +00:00
parent 21d61e1def
commit 6c8586df23
2 changed files with 69 additions and 6 deletions

View File

@@ -0,0 +1,23 @@
/* Copyright (C) 2015
* swift project Community / Contributors
*
* This file is part of swift project. It is subject to the license terms in the LICENSE file found in the top-level
* directory of this distribution and at http://www.swift-project.org/license.html. No part of swift project,
* including this file, may be copied, modified, propagated, or distributed except according to the terms
* contained in the LICENSE file.
*/
#include "lockfree.h"
namespace BlackMisc
{
namespace Private
{
// this is only needed for GCC <= 4.9, but we define it for all compilers to avoid warning about empty cpp file
QMutex *atomicSharedPtrMutex()
{
static QMutex mutex(QMutex::Recursive);
return &mutex;
}
}
};