diff options
| author | Thiago Macieira <thiago.macieira@intel.com> | 2023-04-06 14:48:15 -0300 |
|---|---|---|
| committer | Thiago Macieira <thiago.macieira@intel.com> | 2023-04-25 18:53:30 -0700 |
| commit | 67431e4168dd272d4c422a8bec01580091544fda (patch) | |
| tree | c1b00277d00f15ffbb0de0a5c728d493f98a9c56 /src/widgets/doc/snippets/qtablewidget-using/main.cpp | |
| parent | 825a37da66ac45f0a5589100197146b083a2dbb7 (diff) | |
QMutex/Unix: remove the pthread_mutex_t-based content
For our purposes, the sem_t code is better, so we've preferred it since
commit c7ab816af110ea08809e1aabd8bf1e08967c6d53 (5.7). Olivier wrote in
that commit's message, "It makes tst_QMutex::contendedQMutex with no
msleep 8 times faster".
That's true because QMutex didn't lock the underlying pthread_mutex_t in
QMutex::lock(), as we used the inlined atomic code for the uncontended
case.
It is probably possible to merge the qmutex_mac.cpp and qmutex_unix.cpp
code now (both are based on semaphores), but I won't do that for two
reasons:
1) At best, the PThread functions are going to be thin-wrappers around
the code we already have, like FreeBSD's are around usem (see [1])
2) Darwin has a private API that resembles futexes so we may want to
go that way eventually (see [2])
[1] https://github.com/freebsd/freebsd-src/blob/main/lib/libc/gen/sem_new.c
[2] https://codereview.qt-project.org/335849
Change-Id: Idd5e1bb52be047d7b4fffffd175369b13ba47bed
Reviewed-by: MÃ¥rten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Diffstat (limited to 'src/widgets/doc/snippets/qtablewidget-using/main.cpp')
0 files changed, 0 insertions, 0 deletions
