wavelength 1.0.0
Loading...
Searching...
No Matches
taskdonenotifier.h
Go to the documentation of this file.
1#pragma once
2
3#include "os/task.h"
4
11public:
19 }
20
27 virtual void NotifyWhenDone(Task *pTask, const char *pszName) = 0;
28
38 static void ReportDone(Task *pTask) {
39 pTask->Finish(true);
40 }
41};
Object a task can ask to report when a named piece of work is done.
Definition taskdonenotifier.h:10
static void ReportDone(Task *pTask)
Tell a waiting task that its work is done.
Definition taskdonenotifier.h:38
virtual ~TaskDoneNotifier()
Release the notifier.
Definition taskdonenotifier.h:18
virtual void NotifyWhenDone(Task *pTask, const char *pszName)=0
Arrange for a task to learn when the named work is done.
Unit of work an owner starts, polls until it reports that it is done, and stops.
Definition task.h:9
void Finish(bool bSucceeded)
End the task from outside its poll, and call OnStop() when it was running.