From ac7ca49af5221b7817c3401906579db106a502d6 Mon Sep 17 00:00:00 2001 From: Daniel Larimer Date: Mon, 10 Sep 2012 22:33:09 -0500 Subject: [PATCH] clean up prints --- include/fc/signals.hpp | 3 +-- src/thread.cpp | 9 ++------- src/thread_d.hpp | 2 -- 3 files changed, 3 insertions(+), 11 deletions(-) diff --git a/include/fc/signals.hpp b/include/fc/signals.hpp index 99d262c..105fdc4 100644 --- a/include/fc/signals.hpp +++ b/include/fc/signals.hpp @@ -22,8 +22,7 @@ namespace fc { inline void wait( boost::signal& sig, const microseconds& timeout_us=microseconds::max() ) { promise::ptr p(new promise()); - boost::signals::scoped_connection c = sig.connect( [=]() { slog( "set value!" );p->set_value(); } ); - slog( "wait quit" ); + boost::signals::scoped_connection c = sig.connect( [=]() { p->set_value(); } ); p->wait( timeout_us ); } } diff --git a/src/thread.cpp b/src/thread.cpp index 53b95d3..28d5de8 100644 --- a/src/thread.cpp +++ b/src/thread.cpp @@ -31,11 +31,10 @@ namespace fc { p->set_value(); exec(); } catch ( ... ) { - elog( "Caught unhandled exception" ); + elog( "Caught unhandled exception %1%", boost::current_exception_diagnostic_information() ); } - slog( "exiting %s", name ); delete this->my; - slog( "..." ); + this->my = 0; } ); p->wait(); my->boost_thread = t; @@ -72,7 +71,6 @@ namespace fc { void thread::quit() { if( ¤t() != this ) { - wlog( "async quit %s", my->name.c_str() ); async( [=](){quit();} );//.wait(); if( my->boost_thread ) { auto n = name(); @@ -218,12 +216,10 @@ namespace fc { void thread::poke() { boost::unique_lock lock(my->task_ready_mutex); - slog("notify one"); my->task_ready.notify_one(); } void thread::async_task( task_base* t, const priority& p, const time_point& tp, const char* desc ) { - slog( "%s", name().c_str() ); task_base* stale_head = my->task_in_queue.load(boost::memory_order_relaxed); do { t->_next = stale_head; }while( !my->task_in_queue.compare_exchange_weak( stale_head, t, boost::memory_order_release ) ); @@ -233,7 +229,6 @@ namespace fc { // when *this thread is about to block on a wait condition. if( this != ¤t() && !stale_head ) { boost::unique_lock lock(my->task_ready_mutex); - slog("notify one"); my->task_ready.notify_one(); } } diff --git a/src/thread_d.hpp b/src/thread_d.hpp index 578239e..7ff48ee 100644 --- a/src/thread_d.hpp +++ b/src/thread_d.hpp @@ -321,10 +321,8 @@ namespace fc { if( done ) return; if( timeout_time == time_point::max() ) { - slog("wait"); task_ready.wait( lock ); } else if( timeout_time != time_point::min() ) { - slog("timed wait"); task_ready.wait_until( lock, boost::chrono::system_clock::time_point() + boost::chrono::microseconds(timeout_time.time_since_epoch().count()) ); }