removed continious waiting for condition in (timed)wait