mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-23 00:47:31 +09:00
Add infallibleInit method to ThreadLocal and AssertOwns methods to Mutex
This commit is contained in:
parent
498b121c86
commit
32e0f7f621
2 changed files with 26 additions and 0 deletions
|
|
@ -172,6 +172,21 @@ public:
|
|||
mLock->Unlock();
|
||||
}
|
||||
|
||||
// Assert that the current thread owns the lock right now.
|
||||
void AssertOwns() const
|
||||
{
|
||||
mLock->AssertCurrentThreadOwns();
|
||||
}
|
||||
|
||||
// Assert that aLock is the lock passed to the constructor and that the
|
||||
// current thread owns it. Pointer equality alone is not sufficient because
|
||||
// lock ownership may be temporarily released with BaseAutoUnlock.
|
||||
void AssertOwns(const T& aLock) const
|
||||
{
|
||||
MOZ_ASSERT(&aLock == mLock);
|
||||
AssertOwns();
|
||||
}
|
||||
|
||||
private:
|
||||
BaseAutoLock();
|
||||
BaseAutoLock(BaseAutoLock&);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue