Closed zhongwuzw closed 5 years ago
Even though _identifierToOperations is a weak-weak map, we still need to remove it when we removed operation. Otherwise, it may exists race condition which leads new added completion not be called for example.
_identifierToOperations
completion
A case: Let's assume L384 and L213 runs concurrently, L384 executes firstly, then L213 executes, new added completion would not be called anymore. https://github.com/zhongwuzw/PINOperation/blob/eed328e43f706fa9e4b2cc38e7ed1ba83dbb1c8c/Source/PINOperationQueue.m#L384
https://github.com/zhongwuzw/PINOperation/blob/eed328e43f706fa9e4b2cc38e7ed1ba83dbb1c8c/Source/PINOperationQueue.m#L213
Do you mind rebasing against master for the new GitHub CI?
@garrettmoon Done.
Even though
_identifierToOperations
is a weak-weak map, we still need to remove it when we removed operation. Otherwise, it may exists race condition which leads new addedcompletion
not be called for example.A case: Let's assume L384 and L213 runs concurrently, L384 executes firstly, then L213 executes, new added
completion
would not be called anymore. https://github.com/zhongwuzw/PINOperation/blob/eed328e43f706fa9e4b2cc38e7ed1ba83dbb1c8c/Source/PINOperationQueue.m#L384https://github.com/zhongwuzw/PINOperation/blob/eed328e43f706fa9e4b2cc38e7ed1ba83dbb1c8c/Source/PINOperationQueue.m#L213