Create wrapper functions for initing the runloop message queue
and freeing it
This commit is contained in:
parent
e378962724
commit
8c1045c1ae
|
@ -2631,14 +2631,11 @@ bool rarch_main_command(unsigned cmd)
|
|||
rarch_main_command(RARCH_CMD_AUTOSAVE_INIT);
|
||||
break;
|
||||
case RARCH_CMD_MSG_QUEUE_DEINIT:
|
||||
if (g_runloop.msg_queue)
|
||||
msg_queue_free(g_runloop.msg_queue);
|
||||
g_runloop.msg_queue = NULL;
|
||||
rarch_main_msg_queue_free();
|
||||
break;
|
||||
case RARCH_CMD_MSG_QUEUE_INIT:
|
||||
rarch_main_command(RARCH_CMD_MSG_QUEUE_DEINIT);
|
||||
if (!g_runloop.msg_queue)
|
||||
rarch_assert(g_runloop.msg_queue = msg_queue_new(8));
|
||||
rarch_main_msg_queue_init();
|
||||
rarch_main_data_init_queues();
|
||||
break;
|
||||
case RARCH_CMD_BSV_MOVIE_DEINIT:
|
||||
|
|
13
runloop.c
13
runloop.c
|
@ -908,6 +908,19 @@ void rarch_main_msg_queue_push(const char *msg, unsigned prio, unsigned duration
|
|||
msg_queue_push(g_runloop.msg_queue, msg, prio, duration);
|
||||
}
|
||||
|
||||
void rarch_main_msg_queue_free(void)
|
||||
{
|
||||
if (g_runloop.msg_queue)
|
||||
msg_queue_free(g_runloop.msg_queue);
|
||||
g_runloop.msg_queue = NULL;
|
||||
}
|
||||
|
||||
void rarch_main_msg_queue_init(void)
|
||||
{
|
||||
if (!g_runloop.msg_queue)
|
||||
rarch_assert(g_runloop.msg_queue = msg_queue_new(8));
|
||||
}
|
||||
|
||||
/**
|
||||
* rarch_main_iterate:
|
||||
*
|
||||
|
|
|
@ -181,6 +181,10 @@ void rarch_main_msg_queue_push(const char *msg, unsigned prio,
|
|||
|
||||
const char *rarch_main_msg_queue_pull(void);
|
||||
|
||||
void rarch_main_msg_queue_free(void);
|
||||
|
||||
void rarch_main_msg_queue_init(void);
|
||||
|
||||
void rarch_main_data_iterate(void);
|
||||
|
||||
void rarch_main_data_init_queues(void);
|
||||
|
|
Loading…
Reference in New Issue