Move synchronisation code into new CTimeoutCondition class + add 1000ms wait timeout.