mirror of
https://github.com/ARMSX2/ARMSX2.git
synced 2026-08-24 16:50:16 -07:00
MTGS: Don't unlock mutex if you're just going to lock it again
Poor MTVU thread getting trolled by the GS thread. By the time it wakes up its lock is taken again. When under contention (GS thread behind the VU thread), this caused the GS thread to waste an additional 8% of its time pointlessly waking the VU thread
This commit is contained in:
+7
-4
@@ -436,10 +436,13 @@ void SysMtgsThread::ExecuteTaskInThread()
|
||||
{
|
||||
MTVU_LOG("MTGS - Waiting on semaXGkick!");
|
||||
vu1Thread.KickStart(true);
|
||||
busy.PartialRelease();
|
||||
// Wait for MTVU to complete vu1 program
|
||||
vu1Thread.semaXGkick.WaitWithoutYield();
|
||||
busy.PartialAcquire();
|
||||
if (!vu1Thread.semaXGkick.TryWait())
|
||||
{
|
||||
busy.PartialRelease();
|
||||
// Wait for MTVU to complete vu1 program
|
||||
vu1Thread.semaXGkick.WaitWithoutYield();
|
||||
busy.PartialAcquire();
|
||||
}
|
||||
Gif_Path& path = gifUnit.gifPath[GIF_PATH_1];
|
||||
GS_Packet gsPack = path.GetGSPacketMTVU(); // Get vu1 program's xgkick packet(s)
|
||||
if (gsPack.size)
|
||||
|
||||
Reference in New Issue
Block a user