spice/server/red_time.h
Alon Levy bc50ff0767 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
2013-08-14 12:08:04 +03:00

16 lines
243 B
C

#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