Fix race condition for celixThreadCondition_timedwaitRelative.
authorPengZheng <howtofly@gmail.com>
Mon, 15 Nov 2021 06:35:35 +0000 (14:35 +0800)
committerPengZheng <howtofly@gmail.com>
Mon, 15 Nov 2021 06:35:35 +0000 (14:35 +0800)
commitefa578e029cc342b118c68f71ce1a33d7947e8d9
treef017c67a14e2a7d4f7c011943f9f9960da13904b
parentbb9179a68fdadda8a4ad3cf79cb7ded0e0db96b6
Fix race condition for celixThreadCondition_timedwaitRelative.

Adjusting system clock between clock_gettime(CLOCK_REALTIME) and
pthread_cond_timedwait may lead to unexpected long blocking. To fix it,
we use CLOCK_MONOTONIC on platforms that support it, while on Mac OS
which does not support CLOCK_MONOTONIC we have
pthread_cond_timedwait_relative_np.
libs/utils/src/celix_threads.c