Commit 7d168c45 by Nicolas Capens

Wait for threads to exit when destroying them.

Bug 19868861 Android does not support canceling threads, but we shouldn't forcefully destroy them anyway, and we already join() all threads before deleting them. So use the same semantics on all platforms and join redundantly. Change-Id: I888e2e64288cf3ac53d570d517f3e0867b8c479e Reviewed-on: https://swiftshader-review.googlesource.com/2667Tested-by: 's avatarNicolas Capens <capn@google.com> Reviewed-by: 's avatarGreg Hartman <ghartman@google.com> Tested-by: 's avatarGreg Hartman <ghartman@google.com> Reviewed-by: 's avatarNicolas Capens <capn@google.com>
parent 20288298
......@@ -29,11 +29,7 @@ namespace sw
Thread::~Thread()
{
#if defined(_WIN32)
CloseHandle(handle);
#else
pthread_cancel(handle);
#endif
join(); // Make threads exit before deleting them to not block here
}
void Thread::join()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment