Preventing transliterator constant from being modified for concurrency concerns #184

merged 1 commit into from Dec 25, 2012


None yet

2 participants


During #initialize, DEFAULT_APPROXIMATIONS is added to approximations. The behavior of #add, though, will delete from the hash in order to stringify each value. When running a multithreaded application, the state of DEFAULT_APPROXIMATIONS will be in flux between threads leading to errors.

tigrish commented Dec 24, 2012

Does this mean all transliteration hashes should have .freeze called on them or is this just for default approximations?


DEFAULT_APPROXIMATIONS is the only hash that would cause these issues because it is class level and modified.

@tigrish tigrish merged commit cb5a9d5 into svenfuchs:master Dec 25, 2012

1 check passed

default The Travis build passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment