This makes sure macOS main thread is a Wine thread as in https://gitlab.winehq.org/wine/wine/-/merge_requests/9579, while keeping its event loop usable for GUI, and makes every other platform work the same. Their main thread is parked for now, but the idea is to use the poll loop for various unix side internal purposes, such as winewayland pipe polling, compositing, etc. On macOS the main loop would be used similarly. -- v4: ntdll: Use CFRunLoopRun to implement sched_run on macOS. ntdll: Spawn the application main thread as a separate thread. server: Initialize process tracing in get_startup_info. ntdll: Send process PEB / initial TEB in get_startup_info. ntdll: Call get_startup_info request even when it is empty. ntdll: Pass the startup info size to init_startup_info. server: Create the new process first thread in new_process request. server: Return new process thread handle from get_new_process_info. ntdll: Pass thread security descriptor to new_process request. ntdll: Pass the main thread flags in the new_process request. server: Pass a thread flags parameter to create_thread. https://gitlab.winehq.org/wine/wine/-/merge_requests/10058