Humanizer
Humanizer copied to clipboard
Humanizer inflection vocabulary threading problem
There is a problem with in the Vocabularies class. If you try to read the default vocabulary on two separate threads you can get a index out of range exception because there is no locking around the default variables. There are 3 possible fixes to this.
- Put the default building into a static constructor so that it is only ever called on one thread.
- Put locking around the default variable so that two threads cant manipulate the same vocabulary.
- Change the BuildDefault method so that adds values to a local variable and then at the end of the method set the _default variable.
Thanks for reporting this @thejjmiller. Another alternative I really like is to use Lazy.
Resolved in #439