Merge lp://qastaging/~afrantzis/mir/fix-1441620-simple-dispatch-thread-self-destruction-test into lp://qastaging/mir
Status: | Rejected |
---|---|
Rejected by: | Alan Griffiths |
Proposed branch: | lp://qastaging/~afrantzis/mir/fix-1441620-simple-dispatch-thread-self-destruction-test |
Merge into: | lp://qastaging/mir |
Diff against target: |
80 lines (+22/-1) 3 files modified
include/common/mir/dispatch/simple_dispatch_thread.h (+4/-0) src/common/dispatch/simple_dispatch_thread.cpp (+11/-1) tests/unit-tests/dispatch/test_simple_dispatch_thread.cpp (+7/-0) |
To merge this branch: | bzr merge lp://qastaging/~afrantzis/mir/fix-1441620-simple-dispatch-thread-self-destruction-test |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Chris Halse Rogers | Needs Information | ||
Kevin DuBois (community) | Approve | ||
PS Jenkins bot (community) | continuous-integration | Needs Fixing | |
Alan Griffiths | Approve | ||
Alberto Aguirre (community) | Approve | ||
Review via email:
|
Commit message
tests: Ensure the dispatch thread is finished before leaving the SimpleDispatchT
Description of the change
tests: Ensure the dispatch thread is finished before leaving the SimpleDispatchT
I've been trying to think of away around the issue, but by detaching a thread we don't have any way to synchronize with its destruction. Note that synchronizing with the end of our thread callback is not enough, since the underlying thread keeps copies of the parameters we pass to it which are released when the thread (*not* the std::thread object) is destroyed.
This MP adds a function, used only for testing, that can "steal" the thread on self destruction instead of detaching it, allowing the test to synchronize properly.
As (a very hacky) alternative we could move the handles_
Unmerged revisions
- 2469. By Alexandros Frantzis
-
tests: Ensure the dispatch thread is finished before leaving the SimpleDispatchT
hread.handles_ destruction_ from_dispatch_ callback test
OK.