some debugging code.

This commit is contained in:
crs
2001-10-14 19:16:54 +00:00
parent b3291bc2b5
commit 9435639545
3 changed files with 18 additions and 2 deletions

View File

@@ -3,6 +3,7 @@
#include "CMutex.h"
#include "CLock.h"
#include "XThread.h"
#include "CLog.h"
#include "IJob.h"
#include <assert.h>
@@ -229,14 +230,19 @@ void CThreadRep::doThreadFunc()
catch (XThreadCancel&) {
// client called cancel()
log((CLOG_DEBUG "caught cancel on thread %p", this));
}
catch (XThreadExit& e) {
// client called exit()
result = e.m_result;
log((CLOG_DEBUG "caught exit on thread %p", this));
}
catch (...) {
log((CLOG_DEBUG "caught exit on thread %p", this));
// note -- don't catch (...) to avoid masking bugs
throw;
}
// note -- don't catch (...) to avoid masking bugs
// done with job
delete m_job;
@@ -286,6 +292,7 @@ void CThreadRep::cancel()
m_cancel = true;
// break out of system calls
log((CLOG_DEBUG "cancel thread %p", this));
pthread_kill(m_thread, SIGALRM);
}
}
@@ -304,6 +311,7 @@ void CThreadRep::testCancel()
}
// start cancel
log((CLOG_DEBUG "throw cancel on thread %p", this));
throw XThreadCancel();
}
@@ -401,6 +409,7 @@ void CThreadRep::sleep(double timeout)
void CThreadRep::cancel()
{
log((CLOG_DEBUG "cancel thread %p", this));
SetEvent(m_cancel);
}
@@ -423,6 +432,7 @@ void CThreadRep::testCancel()
}
// start cancel
log((CLOG_DEBUG "throw cancel on thread %p", this));
throw XThreadCancel();
}