had wrong logic in cache detection code
issue #1127 - for Mac, avoid deadlock by replacing queue put with queue offer. Generic mechanism for creating a method that runs a Java method in the UI thread + application of same to addOverlay which was deadlocking.