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

Better thread safety through NSLocking #1184

Merged
merged 1 commit into from
May 4, 2020
Merged

Conversation

designatednerd
Copy link
Contributor

Possible fix for #1181. Noticed as I was investigating a bunch of EXC_BAD_ACCESS crashes that I was making some pretty silly assumptions about multithreading, particularly when it came to when calls are being set up. Multiple threads trying to access the same thing at the same time is a huge recipe for EXC_BAD_ACCESS, so that seemed like a reasonable place to start.

Wrapped the dictionaries underlying URLSessionClient in our Atomic generic wrapper, which uses NSLock to enforce one-thread-at-a-time access. Initial feedback on this fixing the crash seems promising.

This isn't exactly an iOS Meme....

EBhffdbW4AAKLDn

...but it's close.

@designatednerd designatednerd merged commit 36781f4 into master May 4, 2020
@designatednerd designatednerd deleted the fix/atomic-dicts branch May 4, 2020 17:59
@designatednerd designatednerd added this to the Next Release milestone May 4, 2020
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.

1 participant