зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1541571 - Breakpad threads should have names, r=gsvelto.
Differential Revision: https://phabricator.services.mozilla.com/D106417
This commit is contained in:
Родитель
5323d9fe45
Коммит
c79a006552
|
@ -91,6 +91,8 @@ bool CrashGenerationServer::Stop() {
|
|||
|
||||
// static
|
||||
void *CrashGenerationServer::WaitForMessages(void *server) {
|
||||
pthread_setname_np("Breakpad CrashGenerationServer");
|
||||
|
||||
CrashGenerationServer *self =
|
||||
reinterpret_cast<CrashGenerationServer*>(server);
|
||||
while (self->WaitForOneMessage()) {}
|
||||
|
|
|
@ -511,6 +511,8 @@ kern_return_t ForwardException(mach_port_t task, mach_port_t failed_thread,
|
|||
|
||||
// static
|
||||
void* ExceptionHandler::WaitForMessage(void* exception_handler_class) {
|
||||
pthread_setname_np("Breakpad ExceptionHandler");
|
||||
|
||||
ExceptionHandler* self =
|
||||
reinterpret_cast<ExceptionHandler*>(exception_handler_class);
|
||||
ExceptionMessage receive;
|
||||
|
|
|
@ -398,8 +398,20 @@ bool ExceptionHandler::RequestUpload(DWORD crash_id) {
|
|||
return crash_generation_client_->RequestUpload(crash_id);
|
||||
}
|
||||
|
||||
// The SetThreadDescription API was brought in version 1607 of Windows 10.
|
||||
typedef HRESULT(WINAPI* SetThreadDescriptionPtr)(HANDLE hThread,
|
||||
PCWSTR lpThreadDescription);
|
||||
|
||||
// static
|
||||
DWORD ExceptionHandler::ExceptionHandlerThreadMain(void* lpParameter) {
|
||||
static auto SetThreadDescriptionFunc =
|
||||
reinterpret_cast<SetThreadDescriptionPtr>(::GetProcAddress(
|
||||
::GetModuleHandle(L"Kernel32.dll"), "SetThreadDescription"));
|
||||
if (SetThreadDescriptionFunc) {
|
||||
SetThreadDescriptionFunc(::GetCurrentThread(),
|
||||
L"Breakpad ExceptionHandler");
|
||||
}
|
||||
|
||||
ExceptionHandler* self = reinterpret_cast<ExceptionHandler *>(lpParameter);
|
||||
assert(self);
|
||||
assert(self->handler_start_semaphore_ != NULL);
|
||||
|
|
Загрузка…
Ссылка в новой задаче