diff options
author | Thiago Macieira <thiago.macieira@intel.com> | 2012-08-12 12:54:11 +0200 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-08-25 05:41:14 +0200 |
commit | caa22ff8ad9ee85dadf1620a9be24c1d555c1973 (patch) | |
tree | 3a569e86e367b222e4cc82697dd4a73d859c86d3 /src/corelib/kernel | |
parent | 88c7c35b21df302f3d3124ce26e79ec6429d3bde (diff) |
Use nanosleep instead of pthread_cond_timedwait for thread sleeping
There's a comment saying nanosleep's availability is questionable, but
the information of what systems don't have that is now lost in
time. It's quite likely that they were older, Unix systems we no
longer support anyway.
nanosleep comes from POSIX.1b-1993, which is merged into POSIX.1-2001,
so chances are that it's supported almost everywhere where Qt runs
(except for Windows anyway).
Change-Id: I4fd18f8715c43a42429000f3b3d2c3b7343f94b4
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
Reviewed-by: João Abecasis <joao.abecasis@nokia.com>
Diffstat (limited to 'src/corelib/kernel')
-rw-r--r-- | src/corelib/kernel/qcore_unix_p.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/corelib/kernel/qcore_unix_p.h b/src/corelib/kernel/qcore_unix_p.h index 957c646d80..24c2eef399 100644 --- a/src/corelib/kernel/qcore_unix_p.h +++ b/src/corelib/kernel/qcore_unix_p.h @@ -312,6 +312,7 @@ static inline pid_t qt_safe_waitpid(pid_t pid, int *status, int options) // in qelapsedtimer_mac.cpp or qtimestamp_unix.cpp timeval qt_gettime() Q_DECL_NOTHROW; +void qt_nanosleep(timespec amount); Q_CORE_EXPORT int qt_safe_select(int nfds, fd_set *fdread, fd_set *fdwrite, fd_set *fdexcept, const struct timeval *tv); |