Don't use a mutex for computing Reference hash
I don't think we should use any mutex in this code.
Either the hash is very cheap to compute and we compute it each time. Or it's somewhat expensive to compute (== bad hash) and we compute it in the constructor. As far as I can tell, this class is immutable.
Originally posted by @bernardnormier in https://github.com/zeroc-ice/ice/pull/1707#pullrequestreview-1836571809
Fixed by #2120 in C#. Fixed by #2123 in C++.
Fixed by #2437 in Java. And Javascript has no mutex locking.
ice % rg hashInit
js/src/Ice/Reference.js
45: this._hashInitialized = false;
265: if (this._hashInitialized) {
285: this._hashInitialized = true;
990: if (!this._hashInitialized) {
js/src/Ice/IPEndpointI.js
77: this._hashCode = this.hashInit(5381);
170: hashInit(h) {
js/src/Ice/TcpEndpointI.js
185: hashInit(h) {
186: h = super.hashInit(h);
Unfortunately, while JS doesn't use a mutex, it uses the undesirable "hash value caching" logic. Still needs to be fixed.
JavaScript fixed in #2607