Merge lp://qastaging/~nick-dedekind/unity-mir/thready-screenshotting into lp://qastaging/unity-mir

Proposed by Nick Dedekind
Status: Merged
Approved by: Gerry Boland
Approved revision: 246
Merged at revision: 241
Proposed branch: lp://qastaging/~nick-dedekind/unity-mir/thready-screenshotting
Merge into: lp://qastaging/unity-mir
Diff against target: 212 lines (+145/-1)
3 files modified
src/modules/Unity/Application/application.cpp (+17/-1)
src/modules/Unity/Application/application.h (+3/-0)
tests/application_manager_test.cpp (+125/-0)
To merge this branch: bzr merge lp://qastaging/~nick-dedekind/unity-mir/thready-screenshotting
Reviewer Review Type Date Requested Status
Gerry Boland (community) Approve
PS Jenkins bot (community) continuous-integration Approve
Review via email: mp+226282@code.qastaging.launchpad.net

Commit message

Fixed threading issue when screen-shotting application about to be stopped.

Description of the change

 * Are there any related MPs required for this MP to build/function as expected? Please list.
No

 * Did you perform an exploratory manual test run of your code change and any related functionality?
Yes

 * If you changed the packaging (debian), did you subscribe the ubuntu-unity team to this MP?
N/A

To post a comment you must log in.
243. By Nick Dedekind

use QMutex

244. By Nick Dedekind

use qt shared/weak ptr

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Gerry Boland (gerboland) wrote :

+QMutex screenshotMutex;
does this need to live outside the namespace?

+ QMutexLocker lk(&screenshotMutex);
a quick 1 line comment explaining why we're doing this would help the casual reader see why we block in a deconstructor

Code looks good otherwise, am getting ready to test

review: Needs Fixing
245. By Nick Dedekind

added comment

Revision history for this message
Nick Dedekind (nick-dedekind) wrote :

> +QMutex screenshotMutex;
> does this need to live outside the namespace?

Yes, so it can be used in the callback when the application is deleted (member would be deleted).

>
> + QMutexLocker lk(&screenshotMutex);
> a quick 1 line comment explaining why we're doing this would help the casual
> reader see why we block in a deconstructor

Done.

>
> Code looks good otherwise, am getting ready to test

246. By Nick Dedekind

moved mutex into namespace

Revision history for this message
Nick Dedekind (nick-dedekind) wrote :

> > +QMutex screenshotMutex;
> > does this need to live outside the namespace?
>
> Yes, so it can be used in the callback when the application is deleted (member
> would be deleted).

Sorry, misunderstood. no, moved it inside.

>
> >
> > + QMutexLocker lk(&screenshotMutex);
> > a quick 1 line comment explaining why we're doing this would help the casual
> > reader see why we block in a deconstructor
>
> Done.
>
> >
> > Code looks good otherwise, am getting ready to test

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Gerry Boland (gerboland) wrote :

Testing this on a device, for each screenshot take, the UI freezes for 30+ seconds.

review: Needs Fixing
Revision history for this message
Gerry Boland (gerboland) wrote :

Tested just now on N4, worked fine. The UI freeze was a different issue

review: Approve
Revision history for this message
Gerry Boland (gerboland) wrote :

 * Did you perform an exploratory manual test run of the code change and any related functionality?
Y
 * Did CI run pass? If not, please explain why.
Y

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