fix: stop 6.3.4 hanging on launch - #8
Merged
Merged
Conversation
ComputerManager::startPolling() holds m_Lock for write and calls MultiSeatDiscovery::start(). start() called poll() directly, and poll() emits aboutToPoll(), whose slot updateMultiSeatProbeTargets() takes m_Lock for read on the same thread. QReadWriteLock is not recursive, so the main thread waited on itself and the window stopped responding on every launch. start() now queues the first poll on the event loop, so it runs after startPolling() has released the lock. poll() returns early if stop() ran before the queued call was delivered. Verified: the 6.3.4 release zip hangs on launch (main thread blocked in QReadLocker under startPolling, per cdb); 6.3.3 does not. A harness that builds multiseatdiscovery.cpp with the same lock order deadlocks on the 6.3.4 source and passes on this one (first poll still runs within 1 s; no poll after an immediate stop). Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
6.3.4 hangs on every launch. The window opens and then stays "Not Responding".
The cause is a deadlock added in #2.
ComputerManager::startPolling()holdsm_Lockfor write and callsMultiSeatDiscovery::start(). That function polled right away, and the poll'saboutToPollslot takesm_Lockfor read on the same thread.QReadWriteLockis not recursive, so the main thread waited on itself.start()now queues the first poll, so it runs afterstartPolling()releases the lock.poll()does nothing if the timer was stopped before that queued poll arrived.Checked with a small test program built around the real
multiseatdiscovery.cpp. The 6.3.4 code deadlocked within 10 seconds, and the fixed code passed. The full app still needs a CI build and a real launch before release.🤖 Generated with Claude Code