wffweb/src/main/java/com/webfirmframework/wffweb/tag/html/attribute/core/AbstractAttribute.java
protected Collection<ReadLock> getReadLocks() {

        // internally ownerTags.size() (WeakHashMap) contains synchronization
        // better avoid calling it
        // normally there will be one sharedObject so the capacity may be
        // considered as 2 because the load factor is 0.75f
        final Collection<ReadLock> readLocks = new HashSet<>(2);

        for (final AbstractHtml ownerTag : ownerTags) {
            final ReadLock readLock = ownerTag.getSharedObject()
                    .getLock(ACCESS_OBJECT).readLock();
            if (readLock != null) {
                readLocks.add(readLock);
            }
        }

        return readLocks;
    }
protected Collection<ReadLock> getReadLocks() {

        // internally ownerTags.size() (WeakHashMap) contains synchronization
        // better avoid calling it
        // normally there will be one sharedObject so the capacity may be
        // considered as 2 because the load factor is 0.75f
        final Collection<ReadLock> readLocks = new HashSet<>(2);

        for (final AbstractHtml ownerTag : ownerTags) {
            final ReadLock readLock = ownerTag.getSharedObject()
                    .getLock(ACCESS_OBJECT).readLock();
            if (readLock != null) {
                readLocks.add(readLock);
            }
        }

        return readLocks;
    }
NB: this may not return the same locks as there could be the its
ownerTags change. So call only once and reuse it for both lock and unlock
call.

@return the set of read locks