Closed jasmith-hs closed 1 year ago
Oh yeah, I could make the semaphore just a boolean. ThreadLocal is to make sure that PyList and PyMap can still have correct hashCode when done async
Given these are non-concurrent collections do we need to necessarily guarantee multi-threaded support for this hashcode operation? None of the other operations have any kind of locking guarantee in this case. I guess someone could throw in a concurrent map into a pymap and try to use it across multiple threads but that seems pretty atypical for Jinjava use code.
Solves the same problem as https://github.com/HubSpot/jinjava/pull/1111. This demonstrates a different approach where a semaphore is used to ensure that a PyList or PyMap cannot have
hashCode()
called for itself during its ownhashCode()
call.