Browse Source

Use CLOCK_MONOTONIC_RAW when available

Signed-off-by: falkTX <falktx@falktx.com>
tags/v1.9.13
falkTX 6 years ago
parent
commit
a24777a16c
Signed by: falkTX <falktx@falktx.com> GPG Key ID: CDBAA37ABC74FBA0
2 changed files with 8 additions and 0 deletions
  1. +4
    -0
      linux/JackLinuxTime.c
  2. +4
    -0
      linux/alsa/alsa_rawmidi.c

+ 4
- 0
linux/JackLinuxTime.c View File

@@ -143,7 +143,11 @@ static jack_time_t jack_get_microseconds_from_system (void)
jack_time_t jackTime;
struct timespec time;

#ifdef CLOCK_MONOTONIC_RAW
clock_gettime(CLOCK_MONOTONIC_RAW, &time);
#else
clock_gettime(CLOCK_MONOTONIC, &time);
#endif
jackTime = (jack_time_t) time.tv_sec * 1e6 +
(jack_time_t) time.tv_nsec / 1e3;
return jackTime;


+ 4
- 0
linux/alsa/alsa_rawmidi.c View File

@@ -860,7 +860,11 @@ void *midi_thread(void *arg)
struct timespec ts;
ts.tv_sec = 0;
ts.tv_nsec = wait_nanosleep;
#ifdef CLOCK_MONOTONIC_RAW
clock_nanosleep(CLOCK_MONOTONIC_RAW, 0, &ts, NULL);
#else
clock_nanosleep(CLOCK_MONOTONIC, 0, &ts, NULL);
#endif
}
int res = poll((struct pollfd*)&pfds, npfds, poll_timeout);
//debug_log("midi_thread(%s): poll exit: %d", str->name, res);


Loading…
Cancel
Save