Windows fixes

This was SVN commit r8513.
This commit is contained in:
Ykkrosh 2010-10-31 22:26:41 +00:00
parent 602b99c397
commit aefc87f226
3 changed files with 7 additions and 1 deletions

View File

@ -52,6 +52,11 @@ static pthread_t pthread_from_HANDLE(HANDLE h)
// misc
//-----------------------------------------------------------------------------
int pthread_equal(pthread_t t1, pthread_t t2)
{
return t1 == t2;
}
pthread_t pthread_self()
{
return pthread_from_HANDLE(GetCurrentThread());

View File

@ -62,6 +62,7 @@ LIB_API int pthread_once(pthread_once_t*, void (*init_routine)());
// thread
typedef uintptr_t pthread_t;
LIB_API int pthread_equal(pthread_t t1, pthread_t t2);
LIB_API pthread_t pthread_self();
LIB_API int pthread_getschedparam(pthread_t thread, int* policy, struct sched_param* param);
LIB_API int pthread_setschedparam(pthread_t thread, int policy, const struct sched_param* param);

View File

@ -23,7 +23,7 @@ static pthread_t g_MainThread;
bool ThreadUtil::IsMainThread()
{
return pthread_equal(pthread_self(), g_MainThread);
return pthread_equal(pthread_self(), g_MainThread) ? true : false;
}
void ThreadUtil::SetMainThread()