Make sure GetLastError on a PlatformThread return an error that is relevant to the thread.
BUG=none Review-Url: https://codereview.webrtc.org/2541003002 Cr-Commit-Position: refs/heads/master@{#15328}
This commit is contained in:
parent
b49fc142e3
commit
6a2e20ad14
@ -119,6 +119,11 @@ PlatformThread::~PlatformThread() {
|
||||
|
||||
#if defined(WEBRTC_WIN)
|
||||
DWORD WINAPI PlatformThread::StartThread(void* param) {
|
||||
// The GetLastError() function only returns valid results when it is called
|
||||
// after a Win32 API function that returns a "failed" result. A crash dump
|
||||
// contains the result from GetLastError() and to make sure it does not
|
||||
// falsely report a Windows error we call SetLastError here.
|
||||
::SetLastError(ERROR_SUCCESS);
|
||||
static_cast<PlatformThread*>(param)->Run();
|
||||
return 0;
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user