[Swift] Make all the mutexes "let" rather than "var".

Make all the mutexes in the Swift runtime use "let" rather than "var".

They are never changed, and they wouldn't make good mutexes if they were.
This commit is contained in:
Ewan Mellor 2017-11-09 14:44:50 -08:00
parent b4c34da1f0
commit 06300e82bc
No known key found for this signature in database
GPG Key ID: 7CE1C6BC9EC8645D
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)