1
0
mirror of https://foundry.openuru.org/gitblit/r/CWE-ou-minkata.git synced 2025-07-18 11:19:10 +00:00

Remove windoze include from hsThread.h

This commit is contained in:
2012-11-17 19:27:50 -05:00
parent 72000fd0c1
commit bb4d36e69d
9 changed files with 28 additions and 17 deletions

View File

@ -82,6 +82,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
typedef HINSTANCE hsWindowInst;
typedef HINSTANCE HMODULE;
typedef long HRESULT;
typedef void* HANDLE;
#else
typedef int32_t* hsWindowHndl;
typedef int32_t* hsWindowInst;

View File

@ -46,9 +46,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
typedef uint32_t hsMilliseconds;
#ifdef HS_BUILD_FOR_WIN32
# include "hsWindows.h"
#elif defined(HS_BUILD_FOR_UNIX)
#ifdef HS_BUILD_FOR_UNIX
#include <pthread.h>
#include <semaphore.h>
// We can't wait with a timeout with semas
@ -64,7 +62,7 @@ class hsThread
{
public:
#if HS_BUILD_FOR_WIN32
typedef DWORD ThreadId;
typedef uint32_t ThreadId;
#elif HS_BUILD_FOR_UNIX
typedef pthread_t ThreadId;
#endif
@ -88,7 +86,7 @@ public:
virtual ~hsThread(); // calls Stop()
#if HS_BUILD_FOR_WIN32
ThreadId GetThreadId() { return fThreadId; }
static ThreadId GetMyThreadId() { return GetCurrentThreadId(); }
static ThreadId GetMyThreadId();
#elif HS_BUILD_FOR_UNIX
ThreadId GetThreadId() { return fPThread; }
static ThreadId GetMyThreadId() { return pthread_self(); }
@ -204,13 +202,7 @@ public:
class hsSleep
{
public:
#if HS_BUILD_FOR_UNIX
static void Sleep(uint32_t millis);
#elif HS_BUILD_FOR_WIN32
static void Sleep(uint32_t millis) { ::Sleep(millis); }
#endif
};
//////////////////////////////////////////////////////////////////////////////

View File

@ -40,9 +40,9 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
*==LICENSE==*/
#include <process.h>
#include "hsThread.h"
#include "hsWindows.h"
#include <process.h>
#include "hsExceptions.h"
#include "hsMemory.h"
@ -79,6 +79,11 @@ hsThread::~hsThread()
this->Stop();
}
hsThread::ThreadId hsThread::GetMyThreadId()
{
return GetCurrentThreadId();
}
void hsThread::Start()
{
if (fThreadH == nil)
@ -237,4 +242,11 @@ bool hsEvent::Wait(hsMilliseconds timeToWait)
void hsEvent::Signal()
{
::SetEvent(fEvent);
}
}
///////////////////////////////////////////////////////////////
void hsSleep::Sleep(uint32_t millis)
{
::Sleep(millis);
}