Refactor away runloop_msg_queue_pull

This commit is contained in:
twinaphex 2016-02-13 05:17:36 +01:00
parent 45a663c100
commit f1ea400456
4 changed files with 12 additions and 17 deletions

View File

@ -1902,9 +1902,13 @@ void video_driver_frame(const void *data, unsigned width,
unsigned output_width = 0;
unsigned output_height = 0;
unsigned output_pitch = 0;
const char *msg = runloop_msg_queue_pull();
const char *msg = NULL;
settings_t *settings = config_get_ptr();
runloop_ctl(RUNLOOP_CTL_MSG_QUEUE_LOCK, NULL);
runloop_ctl(RUNLOOP_CTL_MSG_QUEUE_PULL, &msg);
runloop_ctl(RUNLOOP_CTL_MSG_QUEUE_UNLOCK, NULL);
if (!video_driver_ctl(RARCH_DISPLAY_CTL_IS_ACTIVE, NULL))
return;

View File

@ -429,13 +429,18 @@ static void xui_frame(void *data)
XuiRenderSetViewTransform( app.GetDC(), &matOrigView );
message = runloop_msg_queue_pull();
runloop_ctl(RUNLOOP_CTL_MSG_QUEUE_LOCK, NULL);
runloop_ctl(RUNLOOP_CTL_MSG_QUEUE_PULL, &message);
runloop_ctl(RUNLOOP_CTL_MSG_QUEUE_UNLOCK, NULL);
if (message)
xui_render_message(message);
else
{
message = runloop_msg_queue_pull();
runloop_ctl(RUNLOOP_CTL_MSG_QUEUE_LOCK, NULL);
runloop_ctl(RUNLOOP_CTL_MSG_QUEUE_PULL, &message);
runloop_ctl(RUNLOOP_CTL_MSG_QUEUE_UNLOCK, NULL);
if (message)
xui_render_message(message);
}

View File

@ -101,17 +101,6 @@ global_t *global_get_ptr(void)
return &g_extern;
}
const char *runloop_msg_queue_pull(void)
{
const char *ret = NULL;
runloop_ctl(RUNLOOP_CTL_MSG_QUEUE_LOCK, NULL);
runloop_ctl(RUNLOOP_CTL_MSG_QUEUE_PULL, &ret);
runloop_ctl(RUNLOOP_CTL_MSG_QUEUE_UNLOCK, NULL);
return ret;
}
void runloop_msg_queue_push(const char *msg,
unsigned prio, unsigned duration,
bool flush)

View File

@ -316,9 +316,6 @@ int runloop_iterate(unsigned *sleep_ms);
void runloop_msg_queue_push(const char *msg, unsigned prio,
unsigned duration, bool flush);
const char *runloop_msg_queue_pull(void);
bool runloop_ctl(enum runloop_ctl_state state, void *data);