Skip to content

Conversation

@vasilenkoigor
Copy link
Contributor

Hi, guys!

  • I suggest this pull-request based on Apple's documentation, which says:

When you subclass NSOperation, you must make sure that any overridden methods remain safe to call from multiple threads. If you implement custom methods in your subclass, such as custom data accessors, you must also make sure those methods are thread-safe. Thus, access to any data variables in the operation must be synchronized to prevent potential data corruption.
NSOperation docs

Analyzing the current code, you can understand that the accessors of our subclass are not fully thread safe.

  • Also, I fixed compiler errors tests building and 'testThatCompoundOperationCancellsCorrectly' fails

I hope this will improve the quality of the project.

@novixon
Copy link
Collaborator

novixon commented May 21, 2017

Hi, @vasilenkoigor!

Thanks for your pull request. The idea to fix the probable issues of asynchronous work is very nice. But before fixing them, we should try to find them out at first. Could you, please, write tests that would show the race conditions and other multithreading issues in the old codebase?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants