You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Apr 6, 2021. It is now read-only.
The records, lists, and listeners HashMaps of RecordHandler are accessed and modified in non-thread safe ways. There is an attempt in some places to make it thread safe with the following double checked pattern:
Record record = records.get( name );
if( record == null ) {
synchronized (this) {
record = records.get( name );
if (record == null) {
record = new Record(name, new HashMap(), connection, deepstreamConfig, client);
records.put(name, record);
...
But that allows HashMap.get to happen simultaneously with HashMap.put. The HashMap javadocs are very clear on this:
If multiple threads access a hash map concurrently, and at least one of the threads modifies the map structurally, it must be synchronized externally.
The text was updated successfully, but these errors were encountered:
The
records
,lists
, andlisteners
HashMaps ofRecordHandler
are accessed and modified in non-thread safe ways. There is an attempt in some places to make it thread safe with the following double checked pattern:But that allows
HashMap.get
to happen simultaneously withHashMap.put
. TheHashMap
javadocs are very clear on this:The text was updated successfully, but these errors were encountered: