MCPcopy Create free account
hub / github.com/antirez/ds4 / worker_main

Function worker_main

ds4_server.c:11067–11079  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

11065}
11066
11067static long server_decode_coalesce_us(void) {
11068 long us = 2000;
11069 const char *env = getenv("DS4_SERVER_DECODE_COALESCE_US");
11070 if (env && env[0]) {
11071 char *end = NULL;
11072 long v = strtol(env, &end, 10);
11073 if (end != env && *end == '\0' && v >= 0 && v <= 100000) us = v;
11074 }
11075 return us;
11076}
11077
11078static void timespec_add_us(struct timespec *ts, long us) {
11079 if (!ts || us <= 0) return;
11080 ts->tv_nsec += (us % 1000000L) * 1000L;
11081 ts->tv_sec += us / 1000000L + ts->tv_nsec / 1000000000L;
11082 ts->tv_nsec %= 1000000000L;

Callers

nothing calls this directly

Calls 2

dequeueFunction · 0.85
generate_jobFunction · 0.85

Tested by

no test coverage detected