![]() |
UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
|
#include "Mac/CocoaThread.h"#include "Containers/LockFreeList.h"#include "HAL/IConsoleManager.h"#include "Templates/RefCounting.h"#include "Misc/OutputDeviceRedirector.h"Classes | |
| class | FCocoaRunLoopSourceInfo |
| class | FCocoaRunLoopTask |
| class | FCocoaRunLoopSource |
Macros | |
| #define | GAME_THREAD_STACK_SIZE 128 * 1024 * 1024 |
Functions | |
| void | MainThreadCall (dispatch_block_t Block, bool const bWait, NSString *WaitMode) |
| void | GameThreadCall (dispatch_block_t Block, bool const bWait, NSArray *SendModes) |
| void | RunGameThread (id Target, SEL Selector) |
| void | ProcessGameThreadEvents (void) |
Variables | |
| NSString * | UnrealNilEventMode = @"@"UnrealNilEventMode" |
| NSString * | UnrealShowEventMode = @"@"UnrealShowEventMode" |
| NSString * | UnrealResizeEventMode = @"@"UnrealResizeEventMode" |
| NSString * | UnrealFullscreenEventMode = @"@"UnrealFullscreenEventMode" |
| NSString * | UnrealCloseEventMode = @"@"UnrealCloseEventMode" |
| NSString * | UnrealIMEEventMode = @"@"UnrealIMEEventMode" |
| uint32 | GMacMainThreadId = 0 |
| __pad0__ | |
| return | Self |
| thread_local NSString * | GThreadInstigatorWaitMode = nullptr |
| #define GAME_THREAD_STACK_SIZE 128 * 1024 * 1024 |
| void GameThreadCall | ( | dispatch_block_t | Block, |
| bool const | bWait = true, |
||
| NSArray * | SendModes = @[NSDefaultRunLoopMode] |
||
| ) |
Schedule a block to be executed on GameThread
| Block | - The block to execute on GameThread, example: ^{ UE_LOG(LogMac, Log, TEXT("Hello GameThread"); } |
| bWait | - Wether or not to wait until the block is executed. |
| SendModes | - The modes for the block we are scheduling, this is use to specify who can execute the scheduled block. |
Be careful to make sure that GameThread will be processing at least one of the modes or you could end up causing a deadlock by preventing further progress.
| void MainThreadCall | ( | dispatch_block_t | Block, |
| bool const | bWait = true, |
||
| NSString * | WaitMode = NSDefaultRunLoopMode |
||
| ) |
Schedule a block to be executed on MainThread.
| Block | - The block to execute on MainThread, example: ^{ UE_LOG(LogMac, Log, TEXT("Hello MainThread"); } |
| bWait | - Wether or not to wait until the block is executed. |
| WaitMode | - The mode we are allowed to execute while waiting. (Only use when bWait = true) |
Avoid being too restrictive on the WaitMode or you could cause a deadlock by preventing further progress.
| __pad0__ |
| uint32 GMacMainThreadId = 0 |
Thread ID of the Mac MainThread
| thread_local NSString* GThreadInstigatorWaitMode = nullptr |
| return Self |
| NSString* UnrealCloseEventMode = @"@"UnrealCloseEventMode" |
| NSString* UnrealFullscreenEventMode = @"@"UnrealFullscreenEventMode" |
| NSString* UnrealIMEEventMode = @"@"UnrealIMEEventMode" |
| NSString* UnrealNilEventMode = @"@"UnrealNilEventMode" |
| NSString* UnrealResizeEventMode = @"@"UnrealResizeEventMode" |
| NSString* UnrealShowEventMode = @"@"UnrealShowEventMode" |