forked from jasder/antlr
[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:
parent
b4c34da1f0
commit
06300e82bc
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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],
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue