changed reentrentlock to using syncnhronized to prevent interruped exceptions being thrown because of timeout