[glib] Use clock_nanosleep if available (mono/mono#15443)
authorVlad Brezae <brezaevlad@gmail.com>
Fri, 19 Jul 2019 07:21:21 +0000 (10:21 +0300)
committerGitHub <noreply@github.com>
Fri, 19 Jul 2019 07:21:21 +0000 (10:21 +0300)
commite2eb6141ca059fdd8cc1c0dd8b7e2447f1b28c6e
tree58fcf3cbbafaf3947417fbcab8b29aa76eb5ccb0
parent2187b7b3d701311e45a0a417f733e52b3d55616a
[glib] Use clock_nanosleep if available (mono/mono#15443)

According to the manual, it is recommended to use clock_nanosleep instead of nanosleep when the sleep can be repeatedly interrupted by signals and resumed. The remaining sleep interval was greater than the original timespec.

Fixes random timeouts of finalizer-abort.exe

Commit migrated from https://github.com/mono/mono/commit/c449308f8bd1c83131b6613711797533504d0c24
src/mono/mono/eglib/gdate-unix.c