[Live-devel] correct way to use TaskScheduler::unscheduleDelayedTask?

Ross Finlayson finlayson at live555.com
Tue Aug 23 08:14:04 PDT 2016


I’m not sure I understand the motivation for your question, because “unscheduleDelayedTask()” is a function that should be called only rarely.  Note that once a ‘schedule task’ has occurred (once), it will not occur again.  (If you want a ‘scheduled task’ to occur periodically, you have to explicitly re-call “scheduleDelayedTask()” in the task handler.)  You need to call “unscheduleDelayedTask()” ONLY IF you have a pending ‘scheduled task’ that has not yet occurred.

Furthermore, once a ‘scheduled task’ has occurred, its ‘TaskToken’ is no longer valid, and should not be used again.  Therefore, you MUST NOT call “unscheduleDelayedTask()” (or “rescheduleDelayedTask()”) on a ‘TaskToken’ after its scheduled task has occurred.

In the next release of the software, I’ll add a comment (to “UsageEnvironment/include/UsageEnvironment.hh”) to make this clear.


Ross Finlayson
Live Networks, Inc.
http://www.live555.com/




More information about the live-devel mailing list