Merge pull request #2112 from ewanmellor/swift-mutexes-let

[Swift] Make all the mutexes "let" rather than "var".
This commit is contained in:
Terence Parr 2017-11-29 09:53:11 -08:00 committed by GitHub
commit 8c1a46d87a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 7 additions and 7 deletions

View File

@ -61,12 +61,12 @@ open class Parser: Recognizer<ParserATNSimulator> {
///
/// mutex for bypassAltsAtnCache updates
///
private var bypassAltsAtnCacheMutex = Mutex()
private let bypassAltsAtnCacheMutex = Mutex()
///
/// mutex for decisionToDFA updates
///
private var decisionToDFAMutex = Mutex()
private let decisionToDFAMutex = Mutex()
///
/// This field maps from the serialized ATN string to the deserialized _org.antlr.v4.runtime.atn.ATN_ with

View File

@ -77,12 +77,12 @@ open class LexerATNSimulator: ATNSimulator {
///
/// mutex for DFAState change
///
private var dfaStateMutex = Mutex()
private let dfaStateMutex = Mutex()
///
/// mutex for changes to all DFAStates map
///
private var dfaStatesMutex = Mutex()
private let dfaStatesMutex = Mutex()
///
/// Used during DFA/ATN exec to record the most recent accept configuration info

View File

@ -281,12 +281,12 @@ open class ParserATNSimulator: ATNSimulator {
///
/// mutex for DFAState change
///
private var dfaStateMutex = Mutex()
private let dfaStateMutex = Mutex()
///
/// mutex for changes in a DFAStates map
///
private var dfaStatesMutex = Mutex()
private let dfaStatesMutex = Mutex()
// /// Testing only!
// public convenience init(_ atn : ATN, _ decisionToDFA : [DFA],

View File

@ -32,7 +32,7 @@ public class DFA: CustomStringConvertible {
///
/// mutex for DFAState changes.
///
private var dfaStateMutex = Mutex()
private let dfaStateMutex = Mutex()
public convenience init(_ atnStartState: DecisionState) {
self.init(atnStartState, 0)