mirror of
https://github.com/debauchee/barrier.git
synced 2026-11-26 05:42:24 +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,7 +1,6 @@
|
||||
#ifndef CTHREADREP_H
|
||||
#define CTHREADREP_H
|
||||
|
||||
#include "CMutex.h"
|
||||
#include "BasicTypes.h"
|
||||
|
||||
#if defined(CONFIG_PTHREADS)
|
||||
@@ -10,6 +9,7 @@
|
||||
#include <windows.h>
|
||||
#endif
|
||||
|
||||
class CMutex;
|
||||
class IJob;
|
||||
|
||||
class CThreadRep {
|
||||
@@ -18,6 +18,9 @@ class CThreadRep {
|
||||
|
||||
// manipulators
|
||||
|
||||
// initialize the thread library
|
||||
static void initThreads();
|
||||
|
||||
// change ref count
|
||||
void ref();
|
||||
void unref();
|
||||
@@ -92,7 +95,7 @@ class CThreadRep {
|
||||
CThreadRep& operator=(const CThreadRep&);
|
||||
|
||||
private:
|
||||
static CMutex s_mutex;
|
||||
static CMutex* s_mutex;
|
||||
static CThreadRep* s_head;
|
||||
|
||||
CThreadRep* m_prev;
|
||||
|
||||
Reference in New Issue
Block a user