Skip to content

Commit

Permalink
WinRT: implemented SDL_DetachThread() for WinRT
Browse files Browse the repository at this point in the history
  • Loading branch information
DavidLudwig committed Nov 29, 2013
1 parent 46740a5 commit 7b5887b
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions src/thread/stdcpp/SDL_systhread.cpp
Expand Up @@ -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()
Expand Down

0 comments on commit 7b5887b

Please sign in to comment.