refactor of second fix attempt for issue #3659
3th fix attempt for issue #3659 by using "java.util.concurrent.locks.ReentrantReadWriteLock"