-
Notifications
You must be signed in to change notification settings - Fork 51
Dispatch queue and pending fetches crash fixes #79
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
base: master
Are you sure you want to change the base?
Conversation
| self.pendingFetchesDispatchQueue.sync(flags: .barrier) { [weak self] in | ||
| guard let self = self else { return } | ||
| self.pendingFetches.removeValue(forKey: groupID) | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not too familiar with how sync() and group.notify() work, but is it possible this could cause some sort of deadlock on the main queue? From the docs on DispatchQueue:
Attempting to synchronously execute a work item on the main queue results in deadlock.
(I used a slightly different approach for wrapping this call in #80.)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure either. I'll take a look at your change. It might be the way to go.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I closed the pull request already, but feel free to reopen it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I cannot speak into the possibility of deadlock here but this is working great for me
|
Is this stale or ready to be merged into master? |
Wrap other cases where we mutate the pendingFetches array in the barrier queue.
Include fix to not release the DispatchQueue for tile image fetches.