Skip to content

Commit

Permalink
DEV9: swap unlocks to avoid potential deadlock
Browse files Browse the repository at this point in the history
  • Loading branch information
refractionpcsx2 committed Jun 10, 2023
1 parent 5a4e212 commit 2190055
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions pcsx2/DEV9/smap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -571,15 +571,12 @@ void smap_write8(u32 addr, u8 value)
//DevCon.WriteLn("DEV9: SMAP_R_RXFIFO_CTRL 8bit write %x", value);
if (value & SMAP_RXFIFO_RESET)
{
reset_lock.lock(); //lock reset mutex 1st
counter_lock.lock();
std::scoped_lock lock(reset_lock, counter_lock);
dev9.rxbdi = 0;
dev9.rxfifo_wr_ptr = 0;
dev9Ru8(SMAP_R_RXFIFO_FRAME_CNT) = 0;
dev9Ru32(SMAP_R_RXFIFO_RD_PTR) = 0;
dev9Ru32(SMAP_R_RXFIFO_SIZE) = 16384;
reset_lock.unlock();
counter_lock.unlock();
}
value &= ~SMAP_RXFIFO_RESET;
dev9Ru8(addr) = value;
Expand Down

0 comments on commit 2190055

Please sign in to comment.