forked from 0ad/0ad
Windows fixes
This was SVN commit r8513.
This commit is contained in:
parent
602b99c397
commit
aefc87f226
@ -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());
|
||||
|
@ -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);
|
||||
|
@ -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()
|
||||
|
Loading…
Reference in New Issue
Block a user