Use .barrier for rangesQueue in syntax highlight

This commit is contained in:
1024jp 2018-05-10 12:17:20 +09:00
parent 2254286bc7
commit 46c6d33508
2 changed files with 3 additions and 2 deletions

View File

@ -14,6 +14,7 @@ unreleased
### Fixes
- [beta] Fix an issue the application could crash while typing.
- [tirivial] Fix an issue on macOS 10.12 and earlier where the Japanese label of the menu item toggling toolbar visibility did not reflect the current visibility state.

View File

@ -154,12 +154,12 @@ final class SyntaxHighlightParseOperation: AsynchronousOperation, ProgressReport
guard !extractedRanges.isEmpty else { return }
rangesQueue.sync {
rangesQueue.async(flags: .barrier) {
ranges += extractedRanges
}
}
highlights[syntaxType] = ranges
highlights[syntaxType] = rangesQueue.sync { ranges }
childProgress.completedUnitCount = childProgress.totalUnitCount
}