aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--xbmc/threads/platform/Condition.h18
-rw-r--r--xbmc/threads/platform/CriticalSection.h19
-rw-r--r--xbmc/threads/platform/Implementation.cpp21
-rw-r--r--xbmc/threads/platform/ThreadLocal.h22
-rw-r--r--xbmc/threads/platform/platform.select26
5 files changed, 38 insertions, 68 deletions
diff --git a/xbmc/threads/platform/Condition.h b/xbmc/threads/platform/Condition.h
index 7d5f41e8b4..57fab79308 100644
--- a/xbmc/threads/platform/Condition.h
+++ b/xbmc/threads/platform/Condition.h
@@ -23,21 +23,11 @@
#include "threads/platform/platform.select"
-#ifdef USE_BOOST_LOCKING
+#ifdef USE_BOOST_THREADING
#include "threads/platform/boost/Condition.h"
-#define LOCKING_IMPL_SET
-#endif
-
-#ifdef USE_PTHREADS_LOCKING
-#ifdef LOCKING_IMPL_SET
-#error "Cannot set two USE_*_LOCKING flags"
-#endif
+#elif (defined USE_PTHREADS_THREADING)
#include "threads/platform/pthreads/Condition.h"
-#define LOCKING_IMPL_SET
-#endif
-
-#ifndef LOCKING_IMPL_SET
-#error "No platform specified for the CriticalSection definition."
+#elif (defined USE_WIN_THREADING)
+#include "threads/platform/win/Condition.h"
#endif
-#undef LOCKING_IMPL_SET
diff --git a/xbmc/threads/platform/CriticalSection.h b/xbmc/threads/platform/CriticalSection.h
index 61de3922bc..92c47108ce 100644
--- a/xbmc/threads/platform/CriticalSection.h
+++ b/xbmc/threads/platform/CriticalSection.h
@@ -23,21 +23,10 @@
#include "threads/platform/platform.select"
-#ifdef USE_BOOST_LOCKING
+#ifdef USE_BOOST_THREADING
#include "threads/platform/boost/CriticalSection.h"
-#define LOCKING_IMPL_SET
-#endif
-
-#ifdef USE_PTHREADS_LOCKING
-#ifdef LOCKING_IMPL_SET
-#error "Cannot set two USE_*_LOCKING flags"
-#endif
+#elif (defined USE_PTHREADS_THREADING)
#include "threads/platform/pthreads/CriticalSection.h"
-#define LOCKING_IMPL_SET
+#elif (defined USE_WIN_THREADING)
+#include "threads/platform/win/CriticalSection.h"
#endif
-
-#ifndef LOCKING_IMPL_SET
-#error "No platform specified for the CriticalSection definition."
-#endif
-
-#undef LOCKING_IMPL_SET
diff --git a/xbmc/threads/platform/Implementation.cpp b/xbmc/threads/platform/Implementation.cpp
index af877b091d..edc5b6ed4e 100644
--- a/xbmc/threads/platform/Implementation.cpp
+++ b/xbmc/threads/platform/Implementation.cpp
@@ -21,21 +21,10 @@
#include "threads/platform/platform.select"
-#ifdef USE_BOOST_LOCKING
-#define LOCKING_IMPL_SET
-// There is no boost implementation cpp file
-#endif
-
-#ifdef USE_PTHREADS_LOCKING
-#ifdef LOCKING_IMPL_SET
-#error "Cannot set two USE_*_LOCKING flags"
-#endif
-#define LOCKING_IMPL_SET
+#ifdef USE_BOOST_THREADING
+// boost has no need of an Implementation.cpp
+#elif (defined USE_PTHREADS_THREADING)
#include "threads/platform/pthreads/Implementation.cpp"
+#elif (defined USE_WIN_THREADING)
+// win has no need of an Implementation.cpp
#endif
-
-#ifndef LOCKING_IMPL_SET
-#error "No platform specified for the implemenation code."
-#endif
-
-#undef LOCKING_IMPL_SET
diff --git a/xbmc/threads/platform/ThreadLocal.h b/xbmc/threads/platform/ThreadLocal.h
index 8bfab286c1..8f126dc371 100644
--- a/xbmc/threads/platform/ThreadLocal.h
+++ b/xbmc/threads/platform/ThreadLocal.h
@@ -23,24 +23,10 @@
#include "threads/platform/platform.select"
-#ifdef USE_BOOST_TLS
+#ifdef USE_BOOST_THREADING
#include "threads/platform/boost/ThreadLocal.h"
-#define TLS_IMPL_SET
-#endif
-
-#ifdef USE_PTHREADS_TLS
-#ifdef TLS_IMPL_SET
-#error "Cannot set two USE_*_TLS flags"
-#endif
+#elif (defined USE_PTHREADS_THREADING)
#include "threads/platform/pthreads/ThreadLocal.h"
-#define TLS_IMPL_SET
-#endif
-
-#ifndef TLS_IMPL_SET
-#error "No platform specified for the CriticalSection definition."
+#elif (defined USE_WIN_THREADING)
+#include "threads/platform/win/ThreadLocal.h"
#endif
-
-#undef TLS_IMPL_SET
-
-
-
diff --git a/xbmc/threads/platform/platform.select b/xbmc/threads/platform/platform.select
index a8a2ef8dd5..e7c30701bc 100644
--- a/xbmc/threads/platform/platform.select
+++ b/xbmc/threads/platform/platform.select
@@ -24,15 +24,31 @@
#if (defined HAVE_CONFIG_H) && (!defined WIN32)
#include "config.h"
#else
- #define USE_BOOST_THREADING 1
+ #ifndef USE_WIN_THREADING
+ #define USE_BOOST_THREADING 1
+ #endif
#endif
#ifdef USE_BOOST_THREADING
-#define USE_BOOST_LOCKING 1
-#define USE_BOOST_TLS 1
+ #define XBMC_THREADING_IMPL_SET 1
#endif
#ifdef USE_PTHREADS_THREADING
-#define USE_PTHREADS_LOCKING 1
-#define USE_PTHREADS_TLS 1
+ #ifdef XBMC_THREADING_IMPL_SET
+ #error "Cannot define both USE_PTHREADS_THREADING and another USE_*_THREADING"
+ #endif
+ #define XBMC_THREADING_IMPL_SET 1
#endif
+
+#ifdef USE_WIN_THREADING
+ #ifdef XBMC_THREADING_IMPL_SET
+ #error "Cannot define both USE_WIN_THREADING and another USE_*_THREADING"
+ #endif
+ #define XBMC_THREADING_IMPL_SET 1
+#endif
+
+#ifndef XBMC_THREADING_IMPL_SET
+ #error "No threading implementation selected."
+#endif
+
+#undef XBMC_THREADING_IMPL_SET