implement CreateThread with boost::thread

I'm not sure why this wasn't done before.

- Removes typedef of pthread_t on Windows, which fixes a native compile issue on mingw.
This commit is contained in:
Wladimir J. van der Laan
2012-08-28 18:26:35 +02:00
parent 74d36d44f2
commit 61d8507140
2 changed files with 13 additions and 52 deletions

View File

@@ -1299,3 +1299,15 @@ void RenameThread(const char* name)
(void)name;
#endif
}
bool CreateThread(void(*pfn)(void*), void* parg)
{
try
{
boost::thread(pfn, parg); // thread detaches when out of scope
} catch(boost::thread_resource_error &e) {
printf("Error creating thread: %s\n", e.what());
return false;
}
return true;
}