mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1067744 - Make GMPMutex reentrant. r=jesup
This commit is contained in:
parent
958564b8ca
commit
4eaaed125c
@ -257,7 +257,7 @@ GMPThreadImpl::Join()
|
||||
}
|
||||
|
||||
GMPMutexImpl::GMPMutexImpl()
|
||||
: mMutex("gmp-mutex")
|
||||
: mMonitor("gmp-mutex")
|
||||
{
|
||||
MOZ_COUNT_CTOR(GMPMutexImpl);
|
||||
}
|
||||
@ -276,13 +276,13 @@ GMPMutexImpl::Destroy()
|
||||
void
|
||||
GMPMutexImpl::Acquire()
|
||||
{
|
||||
mMutex.Lock();
|
||||
mMonitor.Lock();
|
||||
}
|
||||
|
||||
void
|
||||
GMPMutexImpl::Release()
|
||||
{
|
||||
mMutex.Unlock();
|
||||
mMonitor.Unlock();
|
||||
}
|
||||
|
||||
} // namespace gmp
|
||||
|
@ -46,7 +46,7 @@ public:
|
||||
virtual void Destroy() MOZ_OVERRIDE;
|
||||
|
||||
private:
|
||||
Mutex mMutex;
|
||||
Monitor mMonitor;
|
||||
};
|
||||
|
||||
} // namespace gmp
|
||||
|
@ -53,6 +53,8 @@ public:
|
||||
virtual void Join() = 0; // Deletes object after join completes.
|
||||
};
|
||||
|
||||
// A re-entrant monitor; can be locked from the same thread multiple times.
|
||||
// Must be unlocked the same number of times it's locked.
|
||||
class GMPMutex {
|
||||
public:
|
||||
virtual ~GMPMutex() {}
|
||||
|
Loading…
Reference in New Issue
Block a user