Skip to content

Commit

Permalink
Fix possible race condition issue.
Browse files Browse the repository at this point in the history
  • Loading branch information
anr2me committed Feb 5, 2021
1 parent ddc122b commit 04434ea
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions Core/HLE/proAdhoc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1139,18 +1139,18 @@ void AfterMatchingMipsCall::SetData(int ContextID, int eventId, u32_le BufAddr)

bool SetMatchingInCallback(SceNetAdhocMatchingContext* context, bool IsInCB) {
if (context == NULL) return false;
context->eventlock->lock(); //peerlock.lock();
peerlock.lock();
context->IsMatchingInCB = IsInCB;
context->eventlock->unlock(); //peerlock.unlock();
peerlock.unlock();
return IsInCB;
}

bool IsMatchingInCallback(SceNetAdhocMatchingContext* context) {
bool inCB = false;
if (context == NULL) return inCB;
context->eventlock->lock(); //peerlock.lock();
peerlock.lock();
inCB = (context->IsMatchingInCB);
context->eventlock->unlock(); //peerlock.unlock();
peerlock.unlock();
return inCB;
}

Expand Down

0 comments on commit 04434ea

Please sign in to comment.