aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJim Carroll <thecarrolls@jiminger.com>2011-07-18 23:08:34 -0400
committerJim Carroll <thecarrolls@jiminger.com>2011-07-20 00:58:28 -0400
commite82c1434f876e98abde137d4f0f95d04aa63eeac (patch)
treee40f3749d6daabf4b0c040b8e6ecb568f9bd4dfa
parent5b4f95309d1262391e5fb486cebee79f5eb4e3a3 (diff)
removed the need for boost threads.
-rw-r--r--configure.in17
-rw-r--r--xbmc/threads/platform/Condition.h4
-rw-r--r--xbmc/threads/platform/CriticalSection.h4
-rw-r--r--xbmc/threads/platform/Implementation.cpp4
-rw-r--r--xbmc/threads/platform/ThreadLocal.h4
-rw-r--r--xbmc/threads/platform/boost/Condition.h52
-rw-r--r--xbmc/threads/platform/boost/CriticalSection.h36
-rw-r--r--xbmc/threads/platform/boost/ThreadLocal.h42
-rw-r--r--xbmc/threads/platform/platform.select9
9 files changed, 6 insertions, 166 deletions
diff --git a/configure.in b/configure.in
index 1d8baed65f..cb182a9fd1 100644
--- a/configure.in
+++ b/configure.in
@@ -318,12 +318,6 @@ AC_ARG_ENABLE([external-ffmpeg],
[use_external_ffmpeg=$enableval],
[use_external_ffmpeg=$use_external_libraries])
-AC_ARG_ENABLE([pthreads],
- [AS_HELP_STRING([--enable-pthreads],
- [prefer the use of pthreads over boost (default is to use boost for threading) 'Linux only'])],
- [use_pthreads=$enableval],
- [use_pthreads=no])
-
### End of external library options
if test "x$host_vendor" != "xapple"; then
@@ -606,16 +600,7 @@ AC_CHECK_LIB([smbclient], [main],, AC_MSG_ERROR($missing_library))
AC_CHECK_LIB([bluetooth], [hci_devid],, AC_MSG_RESULT([Could not find suitable version of libbluetooth]))
AC_CHECK_LIB([yajl], [main],, AC_MSG_ERROR($missing_library))
AC_LANG_PUSH([C++])
-if test "$use_pthreads" = "no"; then
- AC_CHECK_HEADER([boost/thread.hpp],, AC_MSG_ERROR($missing_library))
- AC_CHECK_LIB([boost_thread],[main],, AC_MSG_ERROR($missing_library))
- AC_DEFINE([USE_BOOST_THREADING], [1], [Whether to use boost as the threading implementation.])
- final_message="$final_message\n Threading:\tBoost"
-else
- AC_CHECK_HEADER([boost/thread.hpp],AC_CHECK_LIB([boost_thread],[main],,), [Missing the boost threading libraries. Using pthreads])
- AC_DEFINE([USE_PTHREADS_THREADING], [1], [Whether to use pthreads as the threading implementation.])
- final_message="$final_message\n Threading:\tpthreads"
-fi
+AC_DEFINE([USE_PTHREADS_THREADING], [1], [Whether to use pthreads as the threading implementation.])
AC_LANG_POP([C++])
PKG_CHECK_MODULES([FONTCONFIG], [fontconfig],
diff --git a/xbmc/threads/platform/Condition.h b/xbmc/threads/platform/Condition.h
index 57fab79308..ccd277d50f 100644
--- a/xbmc/threads/platform/Condition.h
+++ b/xbmc/threads/platform/Condition.h
@@ -23,9 +23,7 @@
#include "threads/platform/platform.select"
-#ifdef USE_BOOST_THREADING
-#include "threads/platform/boost/Condition.h"
-#elif (defined USE_PTHREADS_THREADING)
+#if (defined USE_PTHREADS_THREADING)
#include "threads/platform/pthreads/Condition.h"
#elif (defined USE_WIN_THREADING)
#include "threads/platform/win/Condition.h"
diff --git a/xbmc/threads/platform/CriticalSection.h b/xbmc/threads/platform/CriticalSection.h
index 92c47108ce..ae11421d8d 100644
--- a/xbmc/threads/platform/CriticalSection.h
+++ b/xbmc/threads/platform/CriticalSection.h
@@ -23,9 +23,7 @@
#include "threads/platform/platform.select"
-#ifdef USE_BOOST_THREADING
-#include "threads/platform/boost/CriticalSection.h"
-#elif (defined USE_PTHREADS_THREADING)
+#if (defined USE_PTHREADS_THREADING)
#include "threads/platform/pthreads/CriticalSection.h"
#elif (defined USE_WIN_THREADING)
#include "threads/platform/win/CriticalSection.h"
diff --git a/xbmc/threads/platform/Implementation.cpp b/xbmc/threads/platform/Implementation.cpp
index edc5b6ed4e..5842e1757d 100644
--- a/xbmc/threads/platform/Implementation.cpp
+++ b/xbmc/threads/platform/Implementation.cpp
@@ -21,9 +21,7 @@
#include "threads/platform/platform.select"
-#ifdef USE_BOOST_THREADING
-// boost has no need of an Implementation.cpp
-#elif (defined USE_PTHREADS_THREADING)
+#if (defined USE_PTHREADS_THREADING)
#include "threads/platform/pthreads/Implementation.cpp"
#elif (defined USE_WIN_THREADING)
// win has no need of an Implementation.cpp
diff --git a/xbmc/threads/platform/ThreadLocal.h b/xbmc/threads/platform/ThreadLocal.h
index 8f126dc371..de9ab59a66 100644
--- a/xbmc/threads/platform/ThreadLocal.h
+++ b/xbmc/threads/platform/ThreadLocal.h
@@ -23,9 +23,7 @@
#include "threads/platform/platform.select"
-#ifdef USE_BOOST_THREADING
-#include "threads/platform/boost/ThreadLocal.h"
-#elif (defined USE_PTHREADS_THREADING)
+#if (defined USE_PTHREADS_THREADING)
#include "threads/platform/pthreads/ThreadLocal.h"
#elif (defined USE_WIN_THREADING)
#include "threads/platform/win/ThreadLocal.h"
diff --git a/xbmc/threads/platform/boost/Condition.h b/xbmc/threads/platform/boost/Condition.h
deleted file mode 100644
index cbaeb761cd..0000000000
--- a/xbmc/threads/platform/boost/Condition.h
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- * Copyright (C) 2005-2011 Team XBMC
- * http://www.xbmc.org
- *
- * This Program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2, or (at your option)
- * any later version.
- *
- * This Program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with XBMC; see the file COPYING. If not, write to
- * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
- * http://www.gnu.org/copyleft/gpl.html
- *
- */
-
-#pragma once
-
-#include "threads/Helpers.h"
-#include <boost/thread/condition_variable.hpp>
-
-namespace XbmcThreads
-{
-
- /**
- * This is a thin wrapper around boost::condition_variable. It is subject
- * to "spurious returns" as it is built on boost which is built on posix
- * on many of our platforms.
- */
- class ConditionVariable : public NonCopyable
- {
- private:
- boost::condition_variable_any impl;
-
- public:
- template<typename L> inline void wait(L& lock) { impl.wait(lock); }
-
- template<typename L> inline bool wait(L& lock, unsigned long milliseconds)
- {
- return (impl.timed_wait(lock, boost::posix_time::milliseconds((long)milliseconds)));
- }
-
- inline void notifyAll() { impl.notify_all(); }
- inline void notify() { impl.notify_one(); }
- };
-
-}
diff --git a/xbmc/threads/platform/boost/CriticalSection.h b/xbmc/threads/platform/boost/CriticalSection.h
deleted file mode 100644
index f385ec0696..0000000000
--- a/xbmc/threads/platform/boost/CriticalSection.h
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- * Copyright (C) 2005-2011 Team XBMC
- * http://www.xbmc.org
- *
- * This Program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2, or (at your option)
- * any later version.
- *
- * This Program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with XBMC; see the file COPYING. If not, write to
- * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
- * http://www.gnu.org/copyleft/gpl.html
- *
- */
-
-#pragma once
-
-#include "threads/Lockables.h"
-
-#include <boost/thread/recursive_mutex.hpp>
-
-/**
- * A CCriticalSection is a CountingLockable whose implementation is a boost
- * recursive_mutex.
- *
- * This is not a typedef because of a number of "class CCriticalSection;"
- * forward declarations in the code that break when it's done that way.
- */
-class CCriticalSection : public XbmcThreads::CountingLockable<boost::recursive_mutex> {};
-
diff --git a/xbmc/threads/platform/boost/ThreadLocal.h b/xbmc/threads/platform/boost/ThreadLocal.h
deleted file mode 100644
index 7deb98418e..0000000000
--- a/xbmc/threads/platform/boost/ThreadLocal.h
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
-* Copyright (C) 2005-2011 Team XBMC
-* http://www.xbmc.org
-*
-* This Program is free software; you can redistribute it and/or modify
-* it under the terms of the GNU General Public License as published by
-* the Free Software Foundation; either version 2, or (at your option)
-* any later version.
-*
-* This Program is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-* GNU General Public License for more details.
-*
-* You should have received a copy of the GNU General Public License
-* along with XBMC; see the file COPYING. If not, write to
-* the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
-* http://www.gnu.org/copyleft/gpl.html
-*
-*/
-
-#pragma once
-
-#include <boost/thread/tss.hpp>
-
-namespace XbmcThreads
-{
- /**
- * A thin wrapper around boost::thread_specific_ptr
- */
- template <typename T> class ThreadLocal
- {
- boost::thread_specific_ptr<T> value;
-
- typedef void (*cleanupFunction)(T*);
- public:
- inline ThreadLocal() : value((cleanupFunction)NULL) {}
- inline void set(T* val) { value.reset(val); }
- inline T* get() { return value.get(); }
- };
-}
-
diff --git a/xbmc/threads/platform/platform.select b/xbmc/threads/platform/platform.select
index b089ba59da..f891296d58 100644
--- a/xbmc/threads/platform/platform.select
+++ b/xbmc/threads/platform/platform.select
@@ -24,19 +24,12 @@
#if (defined HAVE_CONFIG_H) && (!defined WIN32)
#include "config.h"
#else
- #ifndef USE_BOOST_THREADING
+ #ifdef WIN32
#define USE_WIN_THREADING 1
#endif
#endif
-#ifdef USE_BOOST_THREADING
- #define XBMC_THREADING_IMPL_SET 1
-#endif
-
#ifdef USE_PTHREADS_THREADING
- #ifdef XBMC_THREADING_IMPL_SET
- #error "Cannot define both USE_PTHREADS_THREADING and another USE_*_THREADING"
- #endif
#define XBMC_THREADING_IMPL_SET 1
#endif