Skip to content

Commit

Permalink
Merge pull request #235 from BoltsFramework/nlutsenko.pedantry
Browse files Browse the repository at this point in the history
Use Barrier version of OSAtomic in taskForCompletionOfAllTasks:.
  • Loading branch information
nlutsenko committed Feb 26, 2016
2 parents 28a8ba9 + aa629d4 commit ca5ff9a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Bolts/Common/BFTask.m
Original file line number Diff line number Diff line change
Expand Up @@ -133,10 +133,10 @@ + (instancetype)taskForCompletionOfAllTasks:(nullable NSArray<BFTask *> *)tasks
[errors addObject:task.error];
}
} else if (task.cancelled) {
OSAtomicIncrement32(&cancelled);
OSAtomicIncrement32Barrier(&cancelled);
}

if (OSAtomicDecrement32(&total) == 0) {
if (OSAtomicDecrement32Barrier(&total) == 0) {
if (exceptions.count > 0) {
if (exceptions.count == 1) {
tcs.exception = [exceptions firstObject];
Expand Down

0 comments on commit ca5ff9a

Please sign in to comment.