Merge pull request #963 from jbescos/reentrantlock

Replace synchronized by ReentrantLock