impl/thread, impl&thread_pool: Log uncatched exception backtrace

master
Perttu Ahola 2014-10-30 03:29:13 +02:00
parent 674146f8c7
commit 6c25e2421f
2 changed files with 6 additions and 2 deletions

View File

@ -3,6 +3,7 @@
#include "interface/thread.h"
#include "interface/mutex.h"
//#include "interface/semaphore.h"
#include "interface/debug.h"
#include "core/log.h"
#include <c55/os.h>
#include <deque>
@ -82,8 +83,9 @@ struct CThread: public Thread
if(thread->m_thing)
thread->m_thing->run(thread);
} catch(std::exception &e){
log_w(MODULE, "ThreadThing of thread %p failed: %s",
arg, e.what());
log_w(MODULE, "ThreadThing of thread %p (%s) failed: %s",
arg, cs(thread_name), e.what());
interface::debug::log_exception_backtrace();
}
log_d(MODULE, "Thread %p (%s) exit", arg, cs(thread_name));

View File

@ -3,6 +3,7 @@
#include "interface/thread_pool.h"
#include "interface/mutex.h"
#include "interface/semaphore.h"
#include "interface/debug.h"
#include "core/log.h"
#include <c55/os.h>
#include <deque>
@ -80,6 +81,7 @@ struct CThreadPool: public ThreadPool
while(!current->thread()) ;
} catch(std::exception &e){
log_w(MODULE, "Worker task failed: %s", e.what());
interface::debug::log_exception_backtrace();
}
// Push the task to pool's output queue
{