mirror of
https://github.com/hrydgard/ppsspp.git
synced 2025-04-02 11:01:50 -04:00
Locking before changing peer linked list order, just to be safe.
This commit is contained in:
parent
581ba6c326
commit
87b712450f
2 changed files with 6 additions and 0 deletions
|
@ -478,9 +478,11 @@ void postAcceptAddSiblings(SceNetAdhocMatchingContext * context, int siblingcoun
|
|||
// Initialize Ping Timer
|
||||
sibling->lastping = CoreTiming::GetGlobalTimeUsScaled(); //real_time_now()*1000000.0;
|
||||
|
||||
peerlock.lock();
|
||||
// Link Peer, should check whether it's already added before
|
||||
sibling->next = context->peerlist;
|
||||
context->peerlist = sibling;
|
||||
peerlock.unlock();
|
||||
|
||||
// Spawn Established Event
|
||||
spawnLocalEvent(context, PSP_ADHOC_MATCHING_EVENT_ESTABLISHED, &sibling->mac, 0, NULL);
|
||||
|
|
|
@ -4875,9 +4875,11 @@ void actOnHelloPacket(SceNetAdhocMatchingContext * context, SceNetEtherAddr * se
|
|||
// Initialize Ping Timer
|
||||
peer->lastping = CoreTiming::GetGlobalTimeUsScaled(); //real_time_now()*1000000.0;
|
||||
|
||||
peerlock.lock();
|
||||
// Link Peer into List
|
||||
peer->next = context->peerlist;
|
||||
context->peerlist = peer;
|
||||
peerlock.unlock();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -4950,9 +4952,11 @@ void actOnJoinPacket(SceNetAdhocMatchingContext * context, SceNetEtherAddr * sen
|
|||
// Initialize Ping Timer
|
||||
peer->lastping = CoreTiming::GetGlobalTimeUsScaled(); //real_time_now()*1000000.0;
|
||||
|
||||
peerlock.lock();
|
||||
// Link Peer into List
|
||||
peer->next = context->peerlist;
|
||||
context->peerlist = peer;
|
||||
peerlock.unlock();
|
||||
|
||||
// Spawn Request Event
|
||||
spawnLocalEvent(context, PSP_ADHOC_MATCHING_EVENT_REQUEST, sendermac, optlen, opt);
|
||||
|
|
Loading…
Add table
Reference in a new issue