Prevent race condition for lookups#2
Merged
Conversation
Member
|
This is fantastic @lipka 💯 Thanks for the pull request! I'll merge, add a changelog entry, and submit a new release to CocoaPods Trunk 🎉 |
ashfurrow
added a commit
that referenced
this pull request
Nov 16, 2015
Prevent race condition for lookups
Member
|
I agree about the sad necessity of the implicitly unwrapped optional – could make the I've pushed a new release up to trunk: https://raw.githubusercontent.com/CocoaPods/Specs/89f45b897166a93e5ecbb427dffdf875eef85ad9/Specs/NSObject+Rx/1.1.0/NSObject+Rx.podspec.json Also, I added you as a collaborator on the repo – may ask for your input on some pull requests if that's ok. Thanks again! |
Maxim-Inv
added a commit
to Maxim-Inv/NSObject-Rx
that referenced
this pull request
Nov 13, 2020
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
There is a possible scenario for a race condition when doing lookups in the existing code from multiple threads.
The suggested solution does both the lookup and assignment in the same critical section.
(Sorry about the force unwrapped optional!)