use Lock and Condition for synchronisation instead of Object