summaryrefslogtreecommitdiffstats
path: root/src/corelib/thread/qmutex_p.h
diff options
context:
space:
mode:
authorThiago Macieira <thiago.macieira@intel.com>2012-08-11 17:13:59 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-01-28 20:52:03 +0100
commit15d7044c82e5f222b6533f3c3876b540dfac2ae0 (patch)
tree024785e6c9887495c3f2ee9fe18afd75b597ea28 /src/corelib/thread/qmutex_p.h
parent70a9caf4de9ddac52783a276a6cdd196eb5fef44 (diff)
Set some attributes on pthread condattrs
Make them use the monotonic clock if that's available. On Mac, the monotonic clock is not available -- Qt fakes monotonic support by using the Mach timebase -- so we need to use gettimeofday. Change-Id: Iaea0b0c0de1b4802780e2476dc3643b703db392c Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Diffstat (limited to 'src/corelib/thread/qmutex_p.h')
-rw-r--r--src/corelib/thread/qmutex_p.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/corelib/thread/qmutex_p.h b/src/corelib/thread/qmutex_p.h
index 1b8bcd6b3a..bec2d934c1 100644
--- a/src/corelib/thread/qmutex_p.h
+++ b/src/corelib/thread/qmutex_p.h
@@ -70,6 +70,8 @@
# define QT_LINUX_FUTEX
#endif
+struct timespec;
+
QT_BEGIN_NAMESPACE
class QMutexData
@@ -137,6 +139,13 @@ public:
#endif //QT_LINUX_FUTEX
+#ifdef Q_OS_UNIX
+// helper functions for qmutex_unix.cpp and qwaitcondition_unix.cpp
+// they are in qwaitcondition_unix.cpp actually
+void qt_initialize_pthread_cond(pthread_cond_t *cond, const char *where);
+void qt_abstime_for_timeout(struct timespec *ts, int timeout);
+#endif
+
QT_END_NAMESPACE
#endif // QMUTEX_P_H