Uh oh!
There was an error while loading. Please reload this page.
Use a flag to prevent hashCode recursion in PyList or PyMap - #1112
Conversation
mattcoley
left a comment
There was a problem hiding this comment.
This would be the equivalent of turning a boolean on and off right? Any reason for the overhead of threadlocal/semaphore object vs. just using a boolean value.
29b9936 to
74a88a7Comparejasmith-hs
commented
Aug 23, 2023
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 |
mattcoley
commented
Aug 23, 2023
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. |
… boolean rather than a ThreadLocal
Solves the same problem as #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.