mirror of
https://github.com/debauchee/barrier.git
synced 2026-02-09 13:15:33 +08:00
fixed timeout bug in CThreadRep::wait() (negative timeout wouldn't
wait forever). also fixed early return from sleep due to signal. now forcing client to initialize CThread to ensure global mutex gets initialized before threads are used.
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
#include "CTimerThread.h"
|
||||
#include "CThread.h"
|
||||
#include "TMethodJob.h"
|
||||
#include "CLog.h"
|
||||
#include <assert.h>
|
||||
|
||||
//
|
||||
@@ -24,7 +25,9 @@ CTimerThread::~CTimerThread()
|
||||
|
||||
void CTimerThread::timer(void*)
|
||||
{
|
||||
log((CLOG_DEBUG "timeout in %f seconds", m_timeout));
|
||||
CThread::sleep(m_timeout);
|
||||
log((CLOG_DEBUG "timeout"));
|
||||
m_callingThread->cancel();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user