Synchronised functions vs Locks