mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-23 06:09:50 -06:00
Have the UI thread do PauseAndLock before messing with GetUsbPointer.
Since its lifetime is managed on the CPU thread, this (or a refactoring) is absolutely required. One of the functions with a PauseAndLock call added is CFrame::UpdateGUI; this is fine now, since it's called only after important events happen, so just make sure not to call it every frame or something :)
This commit is contained in:
@ -224,8 +224,7 @@ u64 GetIdleTicks()
|
||||
// schedule things to be executed on the main thread.
|
||||
void ScheduleEvent_Threadsafe(int cyclesIntoFuture, int event_type, u64 userdata)
|
||||
{
|
||||
// TODO: Fix UI thread safety problems, and enable this assertion
|
||||
// _assert_msg_(POWERPC, !Core::IsCPUThread(), "ScheduleEvent_Threadsafe from wrong thread");
|
||||
_assert_msg_(POWERPC, !Core::IsCPUThread(), "ScheduleEvent_Threadsafe from wrong thread");
|
||||
std::lock_guard<std::mutex> lk(tsWriteLock);
|
||||
Event ne;
|
||||
ne.time = globalTimer + cyclesIntoFuture;
|
||||
@ -287,8 +286,8 @@ static void AddEventToQueue(Event* ne)
|
||||
// than Advance
|
||||
void ScheduleEvent(int cyclesIntoFuture, int event_type, u64 userdata)
|
||||
{
|
||||
// TODO: Fix UI thread safety problems, and enable this assertion
|
||||
//_assert_msg_(POWERPC, Core::IsCPUThread(), "ScheduleEvent from wrong thread");
|
||||
_assert_msg_(POWERPC, Core::IsCPUThread() || Core::GetState() == Core::CORE_PAUSE,
|
||||
"ScheduleEvent from wrong thread");
|
||||
Event *ne = GetNewEvent();
|
||||
ne->userdata = userdata;
|
||||
ne->type = event_type;
|
||||
|
Reference in New Issue
Block a user