Bug 1735129: Add thread's name in nsThread::Shutdown's SpinEventLoopUntil annotation. r=xpcom-reviewers,nika

Differential Revision: https://phabricator.services.mozilla.com/D128270
This commit is contained in:
Jens Stutte 2021-10-21 12:46:06 +00:00
Родитель cf47bf9cbf
Коммит edc33dea57
1 изменённых файлов: 5 добавлений и 1 удалений

Просмотреть файл

@ -855,10 +855,14 @@ nsThread::Shutdown() {
NotNull<nsThreadShutdownContext*> context = WrapNotNull(maybeContext);
// If we are going to hang here we want to see the thread's name
nsAutoCString threadName;
GetThreadName(threadName);
// Process events on the current thread until we receive a shutdown ACK.
// Allows waiting; ensure no locks are held that would deadlock us!
SpinEventLoopUntil(
"nsThread::Shutdown"_ns,
"nsThread::Shutdown: "_ns + threadName,
[&, context]() { return !context->mAwaitingShutdownAck; },
context->mJoiningThread);