Marc-André Lureau | 88c39c8 | 2022-04-20 17:25:47 +0400 | [diff] [blame] | 1 | /* |
| 2 | * This work is licensed under the terms of the GNU GPL, version 2 or later. |
| 3 | * See the COPYING file in the top-level directory. |
| 4 | */ |
| 5 | #ifndef QEMU_MAIN_H |
| 6 | #define QEMU_MAIN_H |
| 7 | |
Phil Dennis-Jordan | f5ab12c | 2024-10-24 12:27:59 +0200 | [diff] [blame] | 8 | /* |
| 9 | * The function to run on the main (initial) thread of the process. |
| 10 | * NULL means QEMU's main event loop. |
| 11 | * When non-NULL, QEMU's main event loop will run on a purposely created |
| 12 | * thread, after which the provided function pointer will be invoked on |
| 13 | * the initial thread. |
| 14 | * This is useful on platforms which treat the main thread as special |
| 15 | * (macOS/Darwin) and/or require all UI API calls to occur from the main |
| 16 | * thread. Those platforms can initialise it to a specific function, |
| 17 | * while UI implementations may reset it to NULL during their init if they |
| 18 | * will handle system and UI events on the main thread via QEMU's own main |
| 19 | * event loop. |
| 20 | */ |
Akihiko Odaki | bab6a30 | 2022-08-19 22:27:54 +0900 | [diff] [blame] | 21 | extern int (*qemu_main)(void); |
Marc-André Lureau | 88c39c8 | 2022-04-20 17:25:47 +0400 | [diff] [blame] | 22 | |
| 23 | #endif /* QEMU_MAIN_H */ |