diff --git a/src/log/logger.cpp b/src/log/logger.cpp index 59aac75..8c4f149 100644 --- a/src/log/logger.cpp +++ b/src/log/logger.cpp @@ -78,9 +78,10 @@ namespace fc { std::unordered_map& get_logger_map() { static bool force_link_default_config = fc::do_default_config; - static std::unordered_map lm; + //TODO: Atomic compare/swap set + static std::unordered_map* lm = new std::unordered_map(); (void)force_link_default_config; // hide warning; - return lm; + return *lm; } logger logger::get( const fc::string& s ) { diff --git a/src/thread/future.cpp b/src/thread/future.cpp index 7783834..0ea1582 100644 --- a/src/thread/future.cpp +++ b/src/thread/future.cpp @@ -26,6 +26,7 @@ namespace fc { } void promise_base::cancel(){ +// wlog("${desc} canceled!", ("desc", _desc? _desc : "")); _canceled = true; } bool promise_base::ready()const { diff --git a/src/thread/thread.cpp b/src/thread/thread.cpp index 260907e..dfa1b87 100644 --- a/src/thread/thread.cpp +++ b/src/thread/thread.cpp @@ -139,7 +139,7 @@ namespace fc { return; } - //wlog( "${s}", ("s",name()) ); +// wlog( "${s}", ("s",name()) ); // We are quiting from our own thread... // break all promises, thread quit! @@ -200,9 +200,9 @@ namespace fc { try { my->process_tasks(); } - catch( canceled_exception& ) + catch( canceled_exception& e ) { - wlog( "thread canceled" ); + wlog( "thread canceled: ${e}", ("e", e.to_detail_string()) ); } delete my->current; my->current = 0; diff --git a/src/thread/thread_d.hpp b/src/thread/thread_d.hpp index b40c096..e156fe4 100644 --- a/src/thread/thread_d.hpp +++ b/src/thread/thread_d.hpp @@ -345,8 +345,10 @@ namespace fc { //current = prev; } - if( current->canceled ) + if( current->canceled ) { + current->canceled = false; FC_THROW_EXCEPTION( canceled_exception, "" ); + } return true; }