Bug 1824465 - Part 1: Introduce ReleaseAssertIsOnMainThread, r=xpcom-reviewers,emilio,kmag

This is like AssertIsOnMainThread, except with a release assert.

Differential Revision: https://phabricator.services.mozilla.com/D173716
This commit is contained in:
Nika Layzell 2023-04-19 22:10:07 +00:00
Родитель 8443f43d87
Коммит 68102ede8d
1 изменённых файлов: 6 добавлений и 0 удалений

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

@ -7,6 +7,7 @@
#ifndef MainThreadUtils_h_
#define MainThreadUtils_h_
#include "mozilla/Assertions.h"
#include "mozilla/ThreadSafety.h"
#include "nscore.h"
@ -47,6 +48,11 @@ inline void AssertIsOnMainThread()
MOZ_ASSERT_CAPABILITY(sMainThreadCapability) {}
# endif
inline void ReleaseAssertIsOnMainThread()
MOZ_ASSERT_CAPABILITY(sMainThreadCapability) {
MOZ_RELEASE_ASSERT(NS_IsMainThread());
}
} // namespace mozilla
#endif