Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes a crash in task callbacks #148

Merged
merged 3 commits into from
Feb 23, 2016
Merged

Fixes a crash in task callbacks #148

merged 3 commits into from
Feb 23, 2016

Conversation

garrettmoon
Copy link
Collaborator

While all methods on tasks are called within the manager's lock,
dispatching to another queue obviously means the manager may not
be locked anymore.

I also moved calling progress download callbacks to the download
task so it's similar to progress image.

Hopefully these issues have been fixed, but it leads me to believe
a better architecture would be to make the tasks immutable by the
manager and have the tasks manage a lock on themselves. I'll need
to think about that more.

While all methods on tasks are called within the manager's lock,
dispatching to another queue obviously means the manager may not
be locked anymore.

I also moved calling progress download callbacks to the download
task so it's similar to progress image.

Hopefully these issues have been fixed, but it leads me to believe
a better architecture would be to make the tasks immutable by the
manager and have the tasks manage a lock on themselves. I'll need
to think about that more.
@garrettmoon
Copy link
Collaborator Author

@maicki Mind taking a look at this PR, I moved some of your code.

@rahul-malik
Copy link
Collaborator

@garrettmoon looks good to me!

garrettmoon added a commit that referenced this pull request Feb 23, 2016
@garrettmoon garrettmoon merged commit ae71a07 into master Feb 23, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants