зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1731564: Use motivated SpinEventLoopUntil inside storage/*. r=janv
Depends on D127232 Differential Revision: https://phabricator.services.mozilla.com/D127233
This commit is contained in:
Родитель
7b6bc8c02e
Коммит
3d9442dbd4
|
@ -1423,7 +1423,9 @@ Connection::SpinningSynchronousClose() {
|
|||
RefPtr<CloseListener> listener = new CloseListener();
|
||||
rv = AsyncClose(listener);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
MOZ_ALWAYS_TRUE(SpinEventLoopUntil([&]() { return listener->mClosed; }));
|
||||
MOZ_ALWAYS_TRUE(
|
||||
SpinEventLoopUntil("storage::Connection::SpinningSynchronousClose"_ns,
|
||||
[&]() { return listener->mClosed; }));
|
||||
MOZ_ASSERT(isClosed(), "The connection should be closed at this point");
|
||||
|
||||
return rv;
|
||||
|
|
|
@ -701,8 +701,10 @@ Service::Observe(nsISupports*, const char* aTopic, const char16_t*) {
|
|||
(void)os->RemoveObserver(this, sObserverTopics[i]);
|
||||
}
|
||||
|
||||
SpinEventLoopUntil([&]() -> bool {
|
||||
// We must wait until all the closing connections are closed.
|
||||
SpinEventLoopUntil("storage::Service::Observe(xpcom-shutdown-threads)"_ns,
|
||||
[&]() -> bool {
|
||||
// We must wait until all the closing connections are
|
||||
// closed.
|
||||
nsTArray<RefPtr<Connection>> connections;
|
||||
getConnections(connections);
|
||||
for (auto& conn : connections) {
|
||||
|
|
Загрузка…
Ссылка в новой задаче