Revert "Replace Execution Engine's mutex with std::recursive_mutex."

This reverts commit 1f502bd9d7, due to
GCC / MinGW's lack of support for C++11 threading.

It's possible this will go back in after we come up with a
reasonable solution.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211401 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Zachary Turner
2014-06-20 21:07:14 +00:00
parent 5b8e73ef81
commit 91e18f7639
7 changed files with 71 additions and 69 deletions

View File

@ -186,19 +186,19 @@ struct LockMutex : ValueMapConfig<KeyT, MutexT> {
};
static void onRAUW(const ExtraData &Data, KeyT Old, KeyT New) {
*Data.CalledRAUW = true;
EXPECT_FALSE(Data.M->try_lock()) << "Mutex should already be locked.";
EXPECT_FALSE(Data.M->tryacquire()) << "Mutex should already be locked.";
}
static void onDelete(const ExtraData &Data, KeyT Old) {
*Data.CalledDeleted = true;
EXPECT_FALSE(Data.M->try_lock()) << "Mutex should already be locked.";
EXPECT_FALSE(Data.M->tryacquire()) << "Mutex should already be locked.";
}
static MutexT *getMutex(const ExtraData &Data) { return Data.M; }
};
#if LLVM_ENABLE_THREADS
TYPED_TEST(ValueMapTest, LocksMutex) {
std::mutex M; // Not recursive.
sys::Mutex M(false); // Not recursive.
bool CalledRAUW = false, CalledDeleted = false;
typedef LockMutex<TypeParam*, std::mutex> ConfigType;
typedef LockMutex<TypeParam*, sys::Mutex> ConfigType;
typename ConfigType::ExtraData Data = {&M, &CalledRAUW, &CalledDeleted};
ValueMap<TypeParam*, int, ConfigType> VM(Data);
VM[this->BitcastV.get()] = 7;