Merge lp:~albaguirre/mir/fix-1427976-take2 into lp:mir
| Status: | Merged |
|---|---|
| Approved by: | Alberto Aguirre on 2015-03-09 |
| Approved revision: | 2371 |
| Merged at revision: | 2379 |
| Proposed branch: | lp:~albaguirre/mir/fix-1427976-take2 |
| Merge into: | lp:mir |
| Diff against target: |
232 lines (+41/-30) 4 files modified
src/server/frontend/session_mediator.cpp (+25/-26) src/server/frontend/session_mediator.h (+2/-0) src/server/frontend/surface_tracker.cpp (+8/-1) src/server/frontend/surface_tracker.h (+6/-3) |
| To merge this branch: | bzr merge lp:~albaguirre/mir/fix-1427976-take2 |
| Related bugs: |
| Reviewer | Review Type | Date Requested | Status |
|---|---|---|---|
| Alexandros Frantzis (community) | Approve on 2015-03-09 | ||
| PS Jenkins bot | continuous-integration | Approve on 2015-03-06 | |
| Alan Griffiths | 2015-03-05 | Approve on 2015-03-06 | |
|
Review via email:
|
|||
Commit Message
Avoid unlocking a mutex in a thread that does not own it.
SessionMediator unlocks its session_mutex before invoking rpc callbacks.
This becomes cumbersome when SessionMediator needs to call Surface:
as the completion function may be executed in an entirely different thread.
The session_mutex should only be unlocked if the completion function is invoked during Surface:
Description of the Change
Avoid unlocking a mutex in a thread that does not own it.
SessionMediator unlocks its session_mutex before invoking rpc callbacks.
This becomes cumbersome when SessionMediator needs to call Surface:
as the completion function may be executed in an entirely different thread.
The session_mutex should only be unlocked if the completion function is invoked during Surface:
| Alan Griffiths (alan-griffiths) wrote : | # |
Ugly, but makes sense in the context of the way the code is currently.
So let's land this, but keep the technical debt around this area on the radar.
- 2371. By Alberto Aguirre on 2015-03-06
-
Make SurfaceTracker thread safe to avoid locking session_mutex.
Locking the session_mutex during the completion callback when executing on a separate
thread can cause lock ordering issues.
| PS Jenkins bot (ps-jenkins) wrote : | # |
PASSED: Continuous integration, rev:2371
http://
Executed test runs:
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
| Alexandros Frantzis (afrantzis) wrote : | # |
Looks good.
+1 for also fixing a potential race in mf::SessionMedi
| Kevin DuBois (kdub) wrote : | # |
> Ugly, but makes sense in the context of the way the code is currently.
>
> So let's land this, but keep the technical debt around this area on the radar.
maybe put it on the backlog?

PASSED: Continuous integration, rev:2370 jenkins. qa.ubuntu. com/job/ mir-ci/ 3146/ jenkins. qa.ubuntu. com/job/ mir-android- vivid-i386- build/1534 jenkins. qa.ubuntu. com/job/ mir-clang- vivid-amd64- build/1533 jenkins. qa.ubuntu. com/job/ mir-mediumtests -vivid- touch/1488 jenkins. qa.ubuntu. com/job/ mir-vivid- amd64-ci/ 1143 jenkins. qa.ubuntu. com/job/ mir-vivid- amd64-ci/ 1143/artifact/ work/output/ *zip*/output. zip jenkins. qa.ubuntu. com/job/ mir-mediumtests -builder- vivid-armhf/ 1488 jenkins. qa.ubuntu. com/job/ mir-mediumtests -builder- vivid-armhf/ 1488/artifact/ work/output/ *zip*/output. zip jenkins. qa.ubuntu. com/job/ mir-mediumtests -runner- mako/4507 s-jenkins. ubuntu- ci:8080/ job/touch- flash-device/ 18603
http://
Executed test runs:
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
Click here to trigger a rebuild: s-jenkins. ubuntu- ci:8080/ job/mir- ci/3146/ rebuild
http://