You've already forked UnrealEngineUWP
mirror of
https://github.com/izzy2lost/UnrealEngineUWP.git
synced 2026-03-26 18:15:20 -07:00
Use the dispatch semaphore to reduce the impact of PerformBlockOnThread by waiting on it with a short timeout. This loop can't wait forever because the run-loop source may need to be rescheduled to complete the outstanding work.
[CL 2654646 by Mark Satterthwaite in Main branch]
This commit is contained in:
committed by
Mark.Satterthwaite@epicgames.com
parent
e72ff42108
commit
f7d222868b
@@ -393,13 +393,11 @@ static void PerformBlockOnThread(FCocoaRunLoopSource& ThreadSource, dispatch_blo
|
||||
dispatch_block_t ExecuteBlock = Block_copy(^{ CopiedBlock(); dispatch_semaphore_signal(Semaphore); });
|
||||
|
||||
ThreadSource.Schedule(ExecuteBlock, SendModes);
|
||||
ThreadSource.Wake();
|
||||
|
||||
while (dispatch_semaphore_wait(Semaphore, DISPATCH_TIME_NOW))
|
||||
{
|
||||
ThreadSource.RunInMode( (CFStringRef)WaitMode );
|
||||
do {
|
||||
ThreadSource.Wake();
|
||||
}
|
||||
ThreadSource.RunInMode( (CFStringRef)WaitMode );
|
||||
} while (dispatch_semaphore_wait(Semaphore, dispatch_time(0, 100000ull)));
|
||||
|
||||
Block_release(ExecuteBlock);
|
||||
dispatch_release(Semaphore);
|
||||
|
||||
Reference in New Issue
Block a user