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:
crs
2001-10-14 18:29:43 +00:00
parent 6aba3a6f57
commit b3291bc2b5
13 changed files with 92 additions and 21 deletions

View File

@@ -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;