// Private methods private bool IsTimeout(taskTimeout_t data) { int now = System.Environment.TickCount; if ((data.timeset == data.timeout) || ((data.timeset < data.timeout) && (now < data.timeset || now > data.timeout)) || ((data.timeset > data.timeout) && (now < data.timeset && now > data.timeout))) { return(true); } return(false); }
private void SetTimeout(ref taskTimeout_t data, int deltaMs) { data.timeset = System.Environment.TickCount; data.timeout = data.timeset + deltaMs; }