mirror of
https://github.com/libretro/RetroArch.git
synced 2025-04-02 10:51:52 -04:00
Create RUNLOOP_CTL_MSG_QUEUE_PULL
This commit is contained in:
parent
c57995b3eb
commit
7803b0d925
2 changed files with 10 additions and 3 deletions
12
runloop.c
12
runloop.c
|
@ -106,9 +106,7 @@ const char *runloop_msg_queue_pull(void)
|
|||
const char *ret = NULL;
|
||||
|
||||
runloop_ctl(RUNLOOP_CTL_MSG_QUEUE_LOCK, NULL);
|
||||
|
||||
ret = msg_queue_pull(g_msg_queue);
|
||||
|
||||
runloop_ctl(RUNLOOP_CTL_MSG_QUEUE_PULL, &ret);
|
||||
runloop_ctl(RUNLOOP_CTL_MSG_QUEUE_UNLOCK, NULL);
|
||||
|
||||
return ret;
|
||||
|
@ -940,6 +938,14 @@ bool runloop_ctl(enum runloop_ctl_state state, void *data)
|
|||
break;
|
||||
case RUNLOOP_CTL_IS_PAUSED:
|
||||
return runloop_paused;
|
||||
case RUNLOOP_CTL_MSG_QUEUE_PULL:
|
||||
{
|
||||
const char **ret = (const char**)data;
|
||||
if (!ret)
|
||||
return false;
|
||||
*ret = msg_queue_pull(g_msg_queue);
|
||||
}
|
||||
return true;
|
||||
case RUNLOOP_CTL_MSG_QUEUE_FREE:
|
||||
#ifdef HAVE_THREADS
|
||||
slock_free(runloop_msg_queue_lock);
|
||||
|
|
|
@ -100,6 +100,7 @@ enum runloop_ctl_state
|
|||
RUNLOOP_CTL_MSG_QUEUE_LOCK,
|
||||
RUNLOOP_CTL_MSG_QUEUE_UNLOCK,
|
||||
RUNLOOP_CTL_MSG_QUEUE_FREE,
|
||||
RUNLOOP_CTL_MSG_QUEUE_PULL,
|
||||
RUNLOOP_CTL_HAS_CORE_OPTIONS,
|
||||
RUNLOOP_CTL_GET_CORE_OPTION_SIZE,
|
||||
RUNLOOP_CTL_IS_CORE_OPTION_UPDATED,
|
||||
|
|
Loading…
Add table
Reference in a new issue