Bug 102839: IO lock contention, causing timeouts - Michael Searle <msearle@brightsign.biz> - 9/18/2017 Back to Bug | Your Reviews | Help
Attachment 136956: [2/3] DBusPendingCall: Only update ->completed under the connection lock - Simon McVittie <smcv@collabora.com> - 1/25/2018 (View )

Show Quick Help

From: Manish Narang <Manish.Narang@kpit.com>
Date: Thu, 25 Jan 2018 11:39:44 +0000
Subject: [PATCH 2/3] DBusPendingCall: Only update ->completed under the
connection lock
If one thread is blocking on a pending call, and another thread is
dispatching the connection, then we need them to agree on the value
of the completed flag by protecting all accesses with a lock. Reads
for this member seem to have the connection lock already, so it's
sufficient to make sure that the only write also happens under the
connection lock.
We already set the completed flag before calling the callback, so it
seems OK to stretch it to meaning that some thread has merely *taken
responsibility for* calling the callback.
The completed flag shares a bitfield with timeout_added, but that
flag is protected by the connection lock already.
Based on suggestions from Simon McVittie on
<https://bugs.freedesktop.org/show_bug.cgi?id=102839>.
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=102839
[smcv: Revert indentation changes; add commit message]
Reviewed-by: Simon McVittie <smcv@collabora.com>
<Overall Comment>
Powered by Splinter

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.