#include <ts/ts.h>
TSAction TSContScheduleEveryOnPool(TSCont contp, TSHRTime every)


Schedules contp to run every milliseconds, on a random thread that belongs to tp. The every is an approximation, meaning it will be at least every milliseconds but possibly more. Resolutions finer than roughly 5 milliseconds will not be effective. Note that contp is required to have a mutex, which is provided to TSContCreate().

The return value can be used to cancel the scheduled event via TSActionCancel(). This is effective until the continuation contp is being dispatched. However, if it is scheduled on another thread this can be problematic to be correctly timed. The return value can be checked with TSActionDone() to see if the continuation ran before the return, which is possible if timeout is 0.

If contp has no thread affinity set, the thread it is now scheduled on will be set as its thread affinity thread.

Note that the TSContSchedule() family of API shall only be called from an ATS EThread. Calling it from raw non-EThreads can result in unpredictable behavior.