summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Support/Threading.cpp
diff options
context:
space:
mode:
authorEric Christopher <echristo@apple.com>2011-09-19 20:43:23 +0000
committerEric Christopher <echristo@apple.com>2011-09-19 20:43:23 +0000
commit4418a602722ecadfc99d54af33cb1d01c7adb1fb (patch)
treeaee7b859aa376cd26dbb75b7585bcd8a80bdedb7 /llvm/lib/Support/Threading.cpp
parent5733271925143bff7a7d2b1faf5dbc9bd747c4c1 (diff)
downloadbcm5719-llvm-4418a602722ecadfc99d54af33cb1d01c7adb1fb.tar.gz
bcm5719-llvm-4418a602722ecadfc99d54af33cb1d01c7adb1fb.zip
Rename LLVM_MULTITHREADED define and fix build without threads.
Patch by Arrowdodger. llvm-svn: 140064
Diffstat (limited to 'llvm/lib/Support/Threading.cpp')
-rw-r--r--llvm/lib/Support/Threading.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/llvm/lib/Support/Threading.cpp b/llvm/lib/Support/Threading.cpp
index bf432a9af71..8f0bb93eb4d 100644
--- a/llvm/lib/Support/Threading.cpp
+++ b/llvm/lib/Support/Threading.cpp
@@ -24,7 +24,7 @@ static bool multithreaded_mode = false;
static sys::Mutex* global_lock = 0;
bool llvm::llvm_start_multithreaded() {
-#ifdef LLVM_MULTITHREADED
+#if ENABLE_THREADS != 0
assert(!multithreaded_mode && "Already multithreaded!");
multithreaded_mode = true;
global_lock = new sys::Mutex(true);
@@ -39,7 +39,7 @@ bool llvm::llvm_start_multithreaded() {
}
void llvm::llvm_stop_multithreaded() {
-#ifdef LLVM_MULTITHREADED
+#if ENABLE_THREADS != 0
assert(multithreaded_mode && "Not currently multithreaded!");
// We fence here to insure that all threaded operations are complete BEFORE we
@@ -63,7 +63,7 @@ void llvm::llvm_release_global_lock() {
if (multithreaded_mode) global_lock->release();
}
-#if defined(LLVM_MULTITHREADED) && defined(HAVE_PTHREAD_H)
+#if ENABLE_THREADS != 0 && defined(HAVE_PTHREAD_H)
#include <pthread.h>
struct ThreadInfo {
@@ -102,7 +102,7 @@ void llvm::llvm_execute_on_thread(void (*Fn)(void*), void *UserData,
error:
::pthread_attr_destroy(&Attr);
}
-#elif defined(LLVM_MULTITHREADED) && defined(LLVM_ON_WIN32)
+#elif ENABLE_THREADS!=0 && defined(LLVM_ON_WIN32)
#include "Windows/Windows.h"
#include <process.h>
OpenPOWER on IntegriCloud