mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-08 19:04:45 +00:00
Bug 1452204 part 1 - Correctly set walkCallingThread. r=glandium
GetCurrentThread() returns a pseudo handle, so comparing it against the passed in argument doesn't make sense in most cases. This patch changes it to using the thread id for comparison, which is guaranteed to be unique in the whole lifetime of a thread. MozReview-Commit-ID: 5TNAgLkcS6m --HG-- extra : rebase_source : 0e72e8f6196c8079086ca697b9a121c6987ef43e
This commit is contained in:
parent
7e7387d0a3
commit
7025ae7cbc
@ -507,9 +507,15 @@ MozStackWalkThread(MozWalkStackCallback aCallback, uint32_t aSkipFrames,
|
||||
return;
|
||||
}
|
||||
|
||||
HANDLE currentThread = ::GetCurrentThread();
|
||||
HANDLE targetThread = aThread ? aThread : currentThread;
|
||||
data.walkCallingThread = (targetThread == currentThread);
|
||||
HANDLE targetThread = aThread;
|
||||
if (!aThread) {
|
||||
targetThread = ::GetCurrentThread();
|
||||
data.walkCallingThread = true;
|
||||
} else {
|
||||
DWORD threadId = ::GetThreadId(aThread);
|
||||
DWORD currentThreadId = ::GetCurrentThreadId();
|
||||
data.walkCallingThread = (threadId == currentThreadId);
|
||||
}
|
||||
|
||||
// Have to duplicate handle to get a real handle.
|
||||
if (!myProcess) {
|
||||
|
Loading…
Reference in New Issue
Block a user