diff options
author | Alon Levy <alevy@redhat.com> | 2013-08-12 15:01:42 +0300 |
---|---|---|
committer | Alon Levy <alevy@redhat.com> | 2013-08-14 12:08:04 +0300 |
commit | bc50ff07676fa0b15df3aa2ae7e54936a8f81f95 (patch) | |
tree | 085148820f4489508d628ade46b3e328ebef6efd /server/red_time.h | |
parent | fe38ddf724a7cd47fe8225ba6b10e9abaaf53c89 (diff) | |
download | spice-bc50ff07676fa0b15df3aa2ae7e54936a8f81f95.tar.gz spice-bc50ff07676fa0b15df3aa2ae7e54936a8f81f95.tar.xz spice-bc50ff07676fa0b15df3aa2ae7e54936a8f81f95.zip |
server: move three functions to red_channel
Three blocking functions, one was split to leave the display channel
specific referencing of the DrawablePipeItem being sent inside
red_worker, but the rest (most) of the timeout logic was moved to
red_channel, including the associated constants.
Moved functions:
red_channel_client_wait_pipe_item_sent
red_wait_outgoing_item
red_wait_all_sent
Introduces red_time.h & red_time.c for a small helper function dealing
with time.h
Diffstat (limited to 'server/red_time.h')
-rw-r--r-- | server/red_time.h | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/server/red_time.h b/server/red_time.h new file mode 100644 index 00000000..ffa97f23 --- /dev/null +++ b/server/red_time.h @@ -0,0 +1,15 @@ +#ifndef H_RED_TIME +#define H_RED_TIME + +#include <time.h> + +static inline uint64_t red_now(void) +{ + struct timespec time; + + clock_gettime(CLOCK_MONOTONIC, &time); + + return ((uint64_t) time.tv_sec) * 1000000000 + time.tv_nsec; +} + +#endif |