Mir

Merge lp://qastaging/~vanvugt/mir/fix-1282886 into lp://qastaging/mir

Proposed by Daniel van Vugt
Status: Merged
Approved by: Daniel van Vugt
Approved revision: no longer in the source branch.
Merged at revision: 1425
Proposed branch: lp://qastaging/~vanvugt/mir/fix-1282886
Merge into: lp://qastaging/mir
Diff against target: 131 lines (+38/-36)
1 file modified
tests/integration-tests/compositor/test_swapping_swappers.cpp (+38/-36)
To merge this branch: bzr merge lp://qastaging/~vanvugt/mir/fix-1282886
Reviewer Review Type Date Requested Status
PS Jenkins bot (community) continuous-integration Approve
Kevin DuBois (community) Approve
Andreas Pokorny (community) Approve
Alan Griffiths Approve
Review via email: mp+207596@code.qastaging.launchpad.net

Commit message

Fix mutex data race reported by helgrind in integration test:
SwapperSwappingStress (LP: #1282886)

Description of the change

.

To post a comment you must log in.
Revision history for this message
Daniel van Vugt (vanvugt) wrote :

Admittedly solving the std::atomic races is ugly. We really should create a class for that or get helgrind itself fixed, somehow.

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Alan Griffiths (alan-griffiths) wrote :

There are two parts to this fix:

the change to client_acquire_blocking has much the same effect as https://code.launchpad.net/~alan-griffiths/mir/keep-helgrind-happy/+merge/207389 and I'm happy with it.

But the other part is writing ugly code to get around the std::atomic issue with helgrind. I don't feel this is an adequate justification for such code (and doesn't solve similar cases elsewhere).

review: Needs Fixing
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Daniel van Vugt (vanvugt) wrote :

Alan, you're right. They're two separate issues which really require separate fixes. I've reverted the bespoke Atomic template and just propose fixing the original mutex/lock race now.

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Alan Griffiths (alan-griffiths) wrote :

> Alan, you're right. They're two separate issues which really require separate
> fixes. I've reverted the bespoke Atomic template and just propose fixing the
> original mutex/lock race now.

You've changed a member atomic<bool> to a local atomic_bool instead of reverting, but OK.

review: Approve
Revision history for this message
Daniel van Vugt (vanvugt) wrote :

So long as the C++ library provides std::atomic_bool, it should be faster to compile and eliminates any risk of template bloat (since it's not a template but a class implemented in the C++ library).

Revision history for this message
Andreas Pokorny (andreas-pokorny) wrote :

ok

review: Approve
Revision history for this message
Kevin DuBois (kdub) wrote :

looks good to me

review: Approve
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) :
review: Approve (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
The diff is not available at this time. You can reload the page or download it.

Subscribers

People subscribed via source and target branches