mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-11-16 02:59:49 +01:00
Implement timeouts on mutexes.
Still need to set timeoutPtr after they expire. Pretty sure I did this the right way, seems CoreTiming does already allow/use multiple events for the same type?
This commit is contained in:
1 parent
b9bb5c4cce
commit
d88fa153b7
5 files changed
+143
-54
No files matched your search
@@ -249,6 +249,43 @@ void ScheduleEvent(int cyclesIntoFuture, int event_type, u64 userdata)
|
||||
AddEventToQueue(ne);
|
||||
}
|
||||
|
||||
void UnscheduleEvent(int event_type, u64 userdata)
|
||||
{
|
||||
if (!first)
|
||||
return;
|
||||
while(first)
|
||||
{
|
||||
if (first->type == event_type && first->userdata == userdata)
|
||||
{
|
||||
Event *next = first->next;
|
||||
FreeEvent(first);
|
||||
first = next;
|
||||
}
|
||||
else
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!first)
|
||||
return;
|
||||
Event *prev = first;
|
||||
Event *ptr = prev->next;
|
||||
while (ptr)
|
||||
{
|
||||
if (ptr->type == event_type && ptr->userdata == userdata)
|
||||
{
|
||||
prev->next = ptr->next;
|
||||
FreeEvent(ptr);
|
||||
ptr = prev->next;
|
||||
}
|
||||
else
|
||||
{
|
||||
prev = ptr;
|
||||
ptr = ptr->next;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void RegisterAdvanceCallback(void (*callback)(int cyclesExecuted))
|
||||
{
|
||||
advanceCallback = callback;
|
||||
|
||||
Reference in new issue
Block a user