Issue #2393 - Part 5 - Extract D3D11MTAutoEnter and reuse

This commit is contained in:
trav90 2023-11-28 14:44:29 -06:00 committed by roytam1
commit 04f124b105
3 changed files with 21 additions and 26 deletions

View file

@ -461,6 +461,20 @@ private:
RefPtr<IDXGIKeyedMutex> mMutex;
};
class D3D11MTAutoEnter
{
public:
explicit D3D11MTAutoEnter(already_AddRefed<ID3D10Multithread> aMT)
: mMT(aMT)
{
mMT->Enter();
}
~D3D11MTAutoEnter() { mMT->Leave(); }
private:
RefPtr<ID3D10Multithread> mMT;
};
}
}