Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r81398 - in trunk: boost/thread/pthread libs/thread/src/pthread
From: vicente.botet_at_[hidden]
Date: 2012-11-17 08:46:50


Author: viboes
Date: 2012-11-17 08:46:49 EST (Sat, 17 Nov 2012)
New Revision: 81398
URL: http://svn.boost.org/trac/boost/changeset/81398

Log:
Thread: Towards removing DateTime dependency on the library binary file.
Text files modified:
   trunk/boost/thread/pthread/thread_data.hpp | 6 ---
   trunk/libs/thread/src/pthread/thread.cpp | 55 ++-------------------------------------
   2 files changed, 5 insertions(+), 56 deletions(-)

Modified: trunk/boost/thread/pthread/thread_data.hpp
==============================================================================
--- trunk/boost/thread/pthread/thread_data.hpp (original)
+++ trunk/boost/thread/pthread/thread_data.hpp 2012-11-17 08:46:49 EST (Sat, 17 Nov 2012)
@@ -231,14 +231,10 @@
         /// Workaround of DECCXX issue of incorrect template substitution
         template<>
 #endif
- void BOOST_THREAD_DECL sleep(system_time const& abs_time)
-#if 1
- ;
-#else
+ inline void sleep(system_time const& abs_time)
         {
           return boost::this_thread::hiden::sleep_until(boost::detail::to_timespec(abs_time));
         }
-#endif
 
         template<typename TimeDuration>
         inline BOOST_SYMBOL_VISIBLE void sleep(TimeDuration const& rel_time)

Modified: trunk/libs/thread/src/pthread/thread.cpp
==============================================================================
--- trunk/libs/thread/src/pthread/thread.cpp (original)
+++ trunk/libs/thread/src/pthread/thread.cpp 2012-11-17 08:46:49 EST (Sat, 17 Nov 2012)
@@ -495,53 +495,6 @@
     } // this_thread
     namespace this_thread
     {
-#if 1
-#ifdef __DECXXX
- /// Workaround of DECCXX issue of incorrect template substitution
- template<>
-#endif // __DECXXX
-#if defined BOOST_THREAD_USES_DATETIME
- void sleep(const system_time& st)
- {
- detail::thread_data_base* const thread_info=detail::get_current_thread_data();
-
- if(thread_info)
- {
- unique_lock<mutex> lk(thread_info->sleep_mutex);
- while(thread_info->sleep_condition.timed_wait(lk,st)) {}
- }
- else
- {
- xtime const xt=get_xtime(st);
-
- for (int foo=0; foo < 5; ++foo)
- {
-# if defined(BOOST_HAS_PTHREAD_DELAY_NP)
- timespec ts;
- to_timespec_duration(xt, ts);
- BOOST_VERIFY(!pthread_delay_np(&ts));
-# elif defined(BOOST_HAS_NANOSLEEP)
- timespec ts;
- to_timespec_duration(xt, ts);
-
- // nanosleep takes a timespec that is an offset, not
- // an absolute time.
- nanosleep(&ts, 0);
-# else
- mutex mx;
- unique_lock<mutex> lock(mx);
- condition cond;
- cond.timed_wait(lock, xt);
-# endif
- xtime cur;
- xtime_get(&cur, TIME_UTC_);
- if (xtime_cmp(xt, cur) <= 0)
- return;
- }
- }
- }
-#endif // BOOST_THREAD_USES_DATETIME
-#endif //1
         void yield() BOOST_NOEXCEPT
         {
 # if defined(BOOST_HAS_SCHED_YIELD)
@@ -549,10 +502,10 @@
 # elif defined(BOOST_HAS_PTHREAD_YIELD)
             BOOST_VERIFY(!pthread_yield());
 # elif defined BOOST_THREAD_USES_DATETIME
- xtime xt;
- xtime_get(&xt, TIME_UTC_);
- sleep(xt);
-# else
+// xtime xt;
+// xtime_get(&xt, TIME_UTC_);
+// sleep(xt);
+//# else
             sleep_for(chrono::milliseconds(0));
 # endif
         }


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk