Fix build on Android: libpthread is deficient and lacks functions

Even if the monotonic clock is available, Android's Bionic lacks the
pthread_condattr_setclock function, so we can't tell it to use the
monotonic clock.

Task-number: QTBUG-30450
Change-Id: I4f53708b1e834ff5d9462b3bf778b96c22662a04
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
Reviewed-by: Paul Olav Tvete <paul.tvete@digia.com>
This commit is contained in:
Thiago Macieira 2013-03-30 10:20:15 -07:00 committed by The Qt Project
parent 4e3b1ee6a6
commit 786c790176

View File

@ -70,7 +70,7 @@ void qt_initialize_pthread_cond(pthread_cond_t *cond, const char *where)
pthread_condattr_t condattr;
pthread_condattr_init(&condattr);
#if !defined(Q_OS_MAC) && (_POSIX_MONOTONIC_CLOCK-0 >= 0)
#if !defined(Q_OS_MAC) && !defined(Q_OS_ANDROID) && (_POSIX_MONOTONIC_CLOCK-0 >= 0)
if (QElapsedTimer::clockType() == QElapsedTimer::MonotonicClock)
pthread_condattr_setclock(&condattr, CLOCK_MONOTONIC);
#endif