Fix possible race condition issue.

This commit is contained in:
ANR2ME committed 2021-02-05 21:54:00 +07:00
1 parent ddc122bcbe
commit 04434ea68e
1 file changed
+4 -4
+4 -4
View File
@@ -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;
}