again, re-add some windows stuff Revert "possibly controversial commit: remove all windows sources, keeping only the windows cmake so that we can generate an sln to edit the code"

This reverts commit 48ba7961eb.
This commit is contained in:
DarthArgus
2016-07-23 18:01:50 -07:00
parent efaaa4bb42
commit 9b369713e1
173 changed files with 16448 additions and 0 deletions
@@ -0,0 +1,60 @@
// ======================================================================
//
// Gate.cpp
//
// Copyright 2001-2002 Sony Online Entertainment
// All Rights Reserved.
//
// ======================================================================
#include "sharedSynchronization/FirstSharedSynchronization.h"
#include "sharedSynchronization/Gate.h"
// ======================================================================
Gate::Gate(bool open)
{
handle = CreateEvent(0, true, open, 0);
DEBUG_FATAL(handle == NULL, ("CreateEvent failed"));
}
// ----------------------------------------------------------------------
Gate::~Gate()
{
CloseHandle(handle);
}
// ----------------------------------------------------------------------
void Gate::wait()
{
int errors = 0;
for (;;)
{
DWORD result = WaitForSingleObject(handle, INFINITE);
if (result == WAIT_OBJECT_0)
return;
++errors;
FATAL(errors >= 3, ("WaitForSingleObject failed multiple times"));
}
}
// ----------------------------------------------------------------------
void Gate::close()
{
const BOOL result = ResetEvent(handle);
FATAL(result == 0, ("ResetEvent failed"));
}
// ----------------------------------------------------------------------
void Gate::open()
{
const BOOL result = SetEvent(handle);
FATAL(result == 0, ("SetEvent failed"));
}
// ======================================================================