summaryrefslogtreecommitdiffstats
path: root/server/red_channel.c
diff options
context:
space:
mode:
authorMarc-André Lureau <marcandre.lureau@gmail.com>2013-09-12 19:32:07 +0200
committerFrediano Ziglio <fziglio@redhat.com>2015-10-29 18:22:19 +0000
commit39b7e55ec7a348055bc7673f7cf1086f1cb9813d (patch)
tree08011295d5ea992fc5d9fef0e61640d1211e6e5e /server/red_channel.c
parent93414b23fa5d87ad94f1bd198dc3be0132d75a15 (diff)
downloadspice-39b7e55ec7a348055bc7673f7cf1086f1cb9813d.tar.gz
spice-39b7e55ec7a348055bc7673f7cf1086f1cb9813d.tar.xz
spice-39b7e55ec7a348055bc7673f7cf1086f1cb9813d.zip
Replace now() with get_mononotonic_time()
Acked-by: Frediano Ziglio <fziglio@redhat.com>
Diffstat (limited to 'server/red_channel.c')
-rw-r--r--server/red_channel.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/server/red_channel.c b/server/red_channel.c
index 5fc34bad..34aa9dce 100644
--- a/server/red_channel.c
+++ b/server/red_channel.c
@@ -43,7 +43,7 @@
#include "reds.h"
#include "reds_stream.h"
#include "main_dispatcher.h"
-#include "red_time.h"
+#include "utils.h"
typedef struct EmptyMsgPipeItem {
PipeItem base;
@@ -2332,7 +2332,7 @@ int red_channel_client_wait_outgoing_item(RedChannelClient *rcc,
return TRUE;
}
if (timeout != -1) {
- end_time = red_now() + timeout;
+ end_time = red_get_monotonic_time() + timeout;
} else {
end_time = UINT64_MAX;
}
@@ -2343,7 +2343,7 @@ int red_channel_client_wait_outgoing_item(RedChannelClient *rcc,
red_channel_client_receive(rcc);
red_channel_client_send(rcc);
} while ((blocked = red_channel_client_blocked(rcc)) &&
- (timeout == -1 || red_now() < end_time));
+ (timeout == -1 || red_get_monotonic_time() < end_time));
if (blocked) {
spice_warning("timeout");
@@ -2365,7 +2365,7 @@ int red_channel_client_wait_pipe_item_sent(RedChannelClient *rcc,
spice_info(NULL);
if (timeout != -1) {
- end_time = red_now() + timeout;
+ end_time = red_get_monotonic_time() + timeout;
} else {
end_time = UINT64_MAX;
}
@@ -2379,7 +2379,7 @@ int red_channel_client_wait_pipe_item_sent(RedChannelClient *rcc,
red_channel_client_push(rcc);
while((item_in_pipe = ring_item_is_linked(&item->link)) &&
- (timeout == -1 || red_now() < end_time)) {
+ (timeout == -1 || red_get_monotonic_time() < end_time)) {
usleep(CHANNEL_BLOCKED_SLEEP_DURATION);
red_channel_client_receive(rcc);
red_channel_client_send(rcc);
@@ -2392,7 +2392,7 @@ int red_channel_client_wait_pipe_item_sent(RedChannelClient *rcc,
return FALSE;
} else {
return red_channel_client_wait_outgoing_item(rcc,
- timeout == -1 ? -1 : end_time - red_now());
+ timeout == -1 ? -1 : end_time - red_get_monotonic_time());
}
}
@@ -2404,7 +2404,7 @@ int red_channel_wait_all_sent(RedChannel *channel,
int blocked = FALSE;
if (timeout != -1) {
- end_time = red_now() + timeout;
+ end_time = red_get_monotonic_time() + timeout;
} else {
end_time = UINT64_MAX;
}
@@ -2412,7 +2412,7 @@ int red_channel_wait_all_sent(RedChannel *channel,
red_channel_push(channel);
while (((max_pipe_size = red_channel_max_pipe_size(channel)) ||
(blocked = red_channel_any_blocked(channel))) &&
- (timeout == -1 || red_now() < end_time)) {
+ (timeout == -1 || red_get_monotonic_time() < end_time)) {
spice_debug("pipe-size %u blocked %d", max_pipe_size, blocked);
usleep(CHANNEL_BLOCKED_SLEEP_DURATION);
red_channel_receive(channel);