mirror of
https://github.com/Ryujinx/SDL.git
synced 2024-12-25 08:15:42 +00:00
WinRT: implemented SDL_DetachThread() for WinRT
This commit is contained in:
parent
46740a5a1c
commit
7b5887b271
|
@ -130,6 +130,26 @@ SDL_SYS_WaitThread(SDL_Thread * thread)
|
|||
}
|
||||
}
|
||||
|
||||
extern "C"
|
||||
void
|
||||
SDL_SYS_DetachThread(SDL_Thread * thread)
|
||||
{
|
||||
if ( ! thread) {
|
||||
return;
|
||||
}
|
||||
|
||||
try {
|
||||
std::thread * cpp_thread = (std::thread *) thread->handle;
|
||||
if (cpp_thread->joinable()) {
|
||||
cpp_thread->detach();
|
||||
}
|
||||
} catch (std::system_error &) {
|
||||
// An error occurred when detaching the thread. SDL_DetachThread does not,
|
||||
// however, seem to provide a means to report errors to its callers
|
||||
// though!
|
||||
}
|
||||
}
|
||||
|
||||
extern "C"
|
||||
SDL_TLSData *
|
||||
SDL_SYS_GetTLSData()
|
||||
|
|
Loading…
Reference in a new issue