50 outstandingThreads(0),
63 CloseHandle(this->
event);
119 ResetEvent(this->
event);
121 DWORD reason = WaitForSingleObject(this->
event, 2000);
122 if (WAIT_TIMEOUT == reason)
124 n_printf(
"Win32ThreadBarrier::Wait() timed out!\n");
138 SetEvent(this->
event);
Critical section objects are used to protect a portion of code from parallel execution.
Block until all thread have arrived at the barrier.
Definition win32threadbarrier.h:19
~Win32ThreadBarrier()
destructor
Definition win32threadbarrier.h:61
void Wait()
call after Arrive() returns false to wait for other threads
Definition win32threadbarrier.h:117
Win32ThreadBarrier()
constructor
Definition win32threadbarrier.h:48
long numThreads
Definition win32threadbarrier.h:38
void SignalContinue()
call after Arrive() returns true to resume all threads
Definition win32threadbarrier.h:135
void Setup(SizeT numThreads)
setup the object with the number of threads
Definition win32threadbarrier.h:71
HANDLE event
Definition win32threadbarrier.h:40
bool isValid
Definition win32threadbarrier.h:41
Threading::CriticalSection critSect
Definition win32threadbarrier.h:37
bool Arrive()
enter thread barrier, return false if not all threads have arrived yet
Definition win32threadbarrier.h:98
bool IsValid() const
return true if the object has been setup
Definition win32threadbarrier.h:83
volatile long outstandingThreads
Definition win32threadbarrier.h:39
void __cdecl n_printf(const char *msg,...)
Nebula's printf replacement.
Definition debug.cc:209
#define n_assert(exp)
Definition debug.h:50
EventId CreateEvent(const EventCreateInfo &info)
create new event
Definition vkevent.cc:42
[TODO: Describe Win32 subsystem]
int SizeT
Definition types.h:49