-
Notifications
You must be signed in to change notification settings - Fork 8
/
retro_emu_thread.h
executable file
·51 lines (42 loc) · 1.45 KB
/
retro_emu_thread.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#ifndef EMU_THREAD_H
#define EMU_THREAD_H
#include <stdbool.h>
/* ScummVM doesn't have a top-level main loop that we can use, so instead we run it in its own thread
* and switch between it and the main thread. Calling this function will block the current thread
* and unblock the other.
*
* This function can be called from either the main or the emulation thread.
*/
void retro_switch_thread(void);
/* Initialize the emulation thread and any related resources.
*
* Only call this function from the main thread.
*/
bool retro_init_emu_thread(void);
/* Destroy the emulation thread and any related resources. Only call this after the emulation thread
* has finished (or canceled) and joined.
*
* Only call this function from the main thread.
*/
void retro_deinit_emu_thread(void);
/* Returns true if the emulation thread was initialized successfully.
*
* This function can be called from either the main or the emulation thread.
*/
bool retro_is_emu_thread_initialized(void);
/* Join the emulation thread. The thread must have exited naturally or been canceled.
*
* Only call this function from the main thread.
*/
void retro_join_emu_thread(void);
/* Cancel the emulation thread.
*
* Only call this function from the main thread.
*/
void retro_cancel_emu_thread(void);
/* Returns true if the emulation thread has exited naturally.
*
* This function can be called from either the main or the emulation thread.
*/
bool retro_emu_thread_exited(void);
#endif