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:
12
src/util.cpp
12
src/util.cpp
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user