Change use of bRunning thread termination variable to use new interruption API in Qt 5.2 #152

Open
opened 2026-02-20 19:15:33 -05:00 by deekerman · 0 comments
Owner

Originally created by @mkrautz on GitHub (Jan 22, 2014).

Originally assigned to: @davidebeatrici on GitHub.

This is not a request to change this, it's more of a note.

Qt 5.2 introduces a new API for requesting thread interruptions and observing them.

See https://doc.qt.io/qt-5/qthread.html#isInterruptionRequested and https://doc.qt.io/qt-5/qthread.html#requestInterruption.

Obviously, we can't make use of these new APIs in the current code, but we could implement similar functions by subclassing QThread and implementing our own variants for Qt < 5.2.

Mumble is currently built for wide variety of arches in, say, Debian, and I think it is a mistake to expect that our current volatile bool bRunning solution works without a hitch on the memory models of all of those architectures.

Qt's implementation is a bool protected by a QMutex. Perhaps we should do the same.

Originally created by @mkrautz on GitHub (Jan 22, 2014). Originally assigned to: @davidebeatrici on GitHub. This is not a request to change this, it's more of a note. Qt 5.2 introduces a new API for requesting thread interruptions and observing them. See https://doc.qt.io/qt-5/qthread.html#isInterruptionRequested and https://doc.qt.io/qt-5/qthread.html#requestInterruption. Obviously, we can't make use of these new APIs in the current code, but we could implement similar functions by subclassing `QThread` and implementing our own variants for Qt < 5.2. Mumble is currently built for wide variety of arches in, say, Debian, and I think it is a mistake to expect that our current `volatile bool bRunning` solution works without a hitch on the memory models of all of those architectures. Qt's implementation is a bool protected by a `QMutex`. Perhaps we should do the same.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/mumble-mumble-voip#152
No description provided.