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;)
Suggestion:
* create a new private static variable of type object called lockobject (for example!) and initialize it in the static constructor
* remove _isInitialized and _mutex
* in Init, avoid to lock _tokens; lock the newly added variable lockobject instead
* implement public bool IsOperator(string item) using dictionary's TryGetValue method
* when scanning _tokens in IsOperator(string item), lock lockobject again
* 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;)
Suggestion:
* create a new private static variable of type object called lockobject (for example!) and initialize it in the static constructor
* remove _isInitialized and _mutex
* in Init, avoid to lock _tokens; lock the newly added variable lockobject instead
* implement public bool IsOperator(string item) using dictionary's TryGetValue method
* when scanning _tokens in IsOperator(string item), lock lockobject again