Preventing transliterator constant from being modified for concurrency concerns #184

Merged
merged 1 commit into from Dec 25, 2012

Projects

None yet

2 participants

@stevenweber

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
Collaborator
tigrish commented Dec 24, 2012

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

@stevenweber

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
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment