Replace epicsThreadSleep() with proper thread synchronization. The main thread was reading runCount without taking lock first. Taking the lock before accessing doneCount might not be necessary given the epicsEventMustWait(), but not 100% sure.
Replace epicsThreadSleep() with proper thread synchronization. The main thread was reading runCount without taking lock first. Taking the lock before accessing doneCount might not be necessary given the epicsEventMustWait(), but not 100% sure.