diff --git a/src/core/common/thread.cpp b/src/core/common/thread.cpp index c1a263bc..a950ca53 100644 --- a/src/core/common/thread.cpp +++ b/src/core/common/thread.cpp @@ -18,20 +18,8 @@ ***************************************************************************/ #include "thread.h" -#include // solve compatibility issues -// This is ugly, but I can't help it. -inline void ADD_MSEC_TO_XTIME(boost::xtime &xt, unsigned msec) -{ - xt.sec += msec / 1000; - xt.nsec += (msec % 1000) * 1000000; - if (xt.nsec > NANOSECONDS_PER_SECOND) { - xt.sec++; - xt.nsec -= NANOSECONDS_PER_SECOND; - } -} - // Helper class for thread creation. class ThreadStarter @@ -92,19 +80,9 @@ Thread::Join(unsigned msecTimeout) tmpIsTerminated = true; } else { // Wait for the termination of the application code. -#if (BOOST_VERSION) >= 103500 boost::defer_lock_t defer; boost::timed_mutex::scoped_timed_lock lock(m_isTerminatedMutex, defer); tmpIsTerminated = lock.timed_lock(boost::posix_time::millisec(msecTimeout)); -#else - // Calculate time after timeout - boost::xtime t; - boost::xtime_get(&t, boost::TIME_UTC); - ADD_MSEC_TO_XTIME(t, msecTimeout); - - boost::timed_mutex::scoped_timed_lock lock(m_isTerminatedMutex, t); - tmpIsTerminated = lock.locked(); -#endif } if (tmpIsTerminated) { @@ -122,11 +100,7 @@ Thread::Join(unsigned msecTimeout) void Thread::Msleep(unsigned msecs) { - boost::xtime t; - boost::xtime_get(&t, boost::TIME_UTC); - ADD_MSEC_TO_XTIME(t, msecs); - - boost::thread::sleep(t); + boost::this_thread::sleep(boost::posix_time::millisec(msecs)); } void @@ -141,14 +115,9 @@ Thread::MainWrapper() bool Thread::ShouldTerminate() const { -#if (BOOST_VERSION) >= 103500 boost::defer_lock_t defer; boost::timed_mutex::scoped_try_lock lock(m_shouldTerminateMutex, defer); return lock.try_lock(); -#else - boost::timed_mutex::scoped_try_lock lock(m_shouldTerminateMutex); - return lock.locked(); -#endif } bool diff --git a/src/core/openssl_wrapper.h b/src/core/openssl_wrapper.h index 293d679a..e6decad3 100644 --- a/src/core/openssl_wrapper.h +++ b/src/core/openssl_wrapper.h @@ -55,7 +55,7 @@ typedef int pid_t; // "2. Can I use OpenSSL with GPL software?" // http://www.openssl.org/support/faq.html#LEGAL2 // -#if defined(_WIN64) || defined(__APPLE__) || defined(__OpenBSD__) || defined(__FreeBSD__) || defined(__NetBSD__) +#if defined(__APPLE__) || defined(__OpenBSD__) || defined(__FreeBSD__) || defined(__NetBSD__) #define HAVE_OPENSSL #endif diff --git a/src/net/common/socket_startup.cpp b/src/net/common/socket_startup.cpp index 762022fa..a7ba4f35 100644 --- a/src/net/common/socket_startup.cpp +++ b/src/net/common/socket_startup.cpp @@ -19,7 +19,6 @@ #include #include -#include // solve compatibility issues #include #include @@ -46,20 +45,12 @@ extern "C" { } int gcry_bmutex_lock(void **obj) { -#if (BOOST_VERSION) >= 103500 ((boost::mutex *)(*obj))->lock(); -#else - boost::detail::thread::lock_ops::lock(*((boost::mutex *)*obj)); -#endif return 0; } int gcry_bmutex_unlock(void **obj) { -#if (BOOST_VERSION) >= 103500 ((boost::mutex *)(*obj))->unlock(); -#else - boost::detail::thread::lock_ops::unlock(*((boost::mutex *)*obj)); -#endif return 0; }