diff options
| author | Thiago Macieira <thiago.macieira@intel.com> | 2024-10-23 10:17:26 -0700 |
|---|---|---|
| committer | Thiago Macieira <thiago.macieira@intel.com> | 2024-11-03 15:18:36 -0700 |
| commit | db880ea6b2b6a5880e84cf362eefdc6b542d54f8 (patch) | |
| tree | d6cb97e77fb8ab5120f4dfcc43ad0e4f66e317e1 /tests/auto/sql/kernel/qsqldatabase/tst_databases.h | |
| parent | 2bce75a6b53cccbf9c813581b64eea87f3ab55fc (diff) | |
QThread/Unix: implement joining of the launched thread, if we can
This is only implemented for OSes that provide a way to perform a timed
join. For all other OSes, we stick to the previous implementation, which
as the comment indicates, may run for arbitrarily long time after wait()
has returned, running user code (e.g., pthread_setspecific() and
thread_local destructors).
Instead, if we perform the joining, we are assured by pthread and the OS
that the thread has exited and no user code remains running.
Unfortunately, this only applies to non-adopted threads, because we
can't pthread_join() a thread we didn't start.
As of this writing, this code only applies to Linux/glibc. MUSL, Bionic
and several BSDs have pthread_timedjoin, but that takes a CLOCK_REALTIME
absolute time, which means it's subject to time jumps, while
QWaitCondition can sometimes use the monotonic clock in those systems.
Change-Id: I692e24d7411742447e10fffd650fe84f6a9cdedd
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Diffstat (limited to 'tests/auto/sql/kernel/qsqldatabase/tst_databases.h')
0 files changed, 0 insertions, 0 deletions
