Concurrency seems not to be managed properly in TokenSeparatorProvider.cs:
* A lock is performed on a variable that is exposed externally (_tokens)
* A lock is not performed on a variable while it could be read/written by other
* Some search operations are performed more times then necessary (return _tokens.ContainsKey(item) && _tokens[item].TokenType == TokenType.Operator;)
* a mutex is not disposed
Suggestion:
* remove _isInitialized and _mutex
* initialize the dictionary in a static constructor
* implement public bool IsOperator(string item) using dictionary's TryGetValue method
Comments: I think it is the correcte way in fixing the race conditions happening on the _tokens dictionary.
* A lock is performed on a variable that is exposed externally (_tokens)
* A lock is not performed on a variable while it could be read/written by other
* Some search operations are performed more times then necessary (return _tokens.ContainsKey(item) && _tokens[item].TokenType == TokenType.Operator;)
* a mutex is not disposed
Suggestion:
* remove _isInitialized and _mutex
* initialize the dictionary in a static constructor
* implement public bool IsOperator(string item) using dictionary's TryGetValue method
Comments: I think it is the correcte way in fixing the race conditions happening on the _tokens dictionary.