[Spice-commits] server/red_worker.c
Frediano Ziglio
fziglio at kemper.freedesktop.org
Thu Sep 3 08:05:58 PDT 2015
server/red_worker.c | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
New commits:
commit 39be1c448cad0b86204753253dcdd6a03fb9a320
Author: Frediano Ziglio <fziglio at redhat.com>
Date: Fri Aug 21 11:15:55 2015 +0100
avoid to call red_get_streams_timout twice computing timeout
Due to how the MIN macro is defined the function was called twice
unless the compiler could demonstrate that was returning the same
value (which actually is impossible as function as clock_gettime
are not deterministic).
Signed-off-by: Frediano Ziglio <fziglio at redhat.com>
Acked-by: Jonathon Jongsma <jjongsma at redhat.com>
diff --git a/server/red_worker.c b/server/red_worker.c
index e7ee6b6..2f2d5a9 100644
--- a/server/red_worker.c
+++ b/server/red_worker.c
@@ -12189,11 +12189,12 @@ SPICE_GNUC_NORETURN void *red_worker_main(void *arg)
for (;;) {
int i, num_events;
- unsigned int timers_queue_timeout;
+ unsigned int timeout;
- timers_queue_timeout = spice_timer_queue_get_timeout_ms();
- worker->event_timeout = MIN(red_get_streams_timout(worker), worker->event_timeout);
- worker->event_timeout = MIN(timers_queue_timeout, worker->event_timeout);
+ timeout = spice_timer_queue_get_timeout_ms();
+ worker->event_timeout = MIN(timeout, worker->event_timeout);
+ timeout = red_get_streams_timout(worker);
+ worker->event_timeout = MIN(timeout, worker->event_timeout);
num_events = poll(worker->poll_fds, MAX_EVENT_SOURCES, worker->event_timeout);
red_handle_streams_timout(worker);
spice_timer_queue_cb();
More information about the Spice-commits
mailing list