Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: src/Scheduler.h

Issue 29370568: Issue #4692 - Move responsibility for engine reference from tasks to scheduler
Patch Set: Created Dec. 31, 2016, 10:37 p.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/JsEngineInternal.h ('k') | src/WebRequestJsObject.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/Scheduler.h
===================================================================
--- a/src/Scheduler.h
+++ b/src/Scheduler.h
@@ -66,7 +66,24 @@
}
}
-/*
+/**
+ * Interface class for scheduled tasks.
+ */
+struct TaskFunctionInterface
+{
+ /**
+ * The main function of the task,
+ * the moral equivalent to the main function of the thread.
+ */
+ virtual void operator()() = 0;
+ /**
+ * Request that the task end itself early, without needing to complete.
+ * Reserved for future use.
+ */
+ virtual void Interrupt() {};
+};
+
+/**
* Execute a task immediately in detached thread that's used only for this task.
*
* The present version is nothing more than a rewrite of the legacy behavior,
« no previous file with comments | « src/JsEngineInternal.h ('k') | src/WebRequestJsObject.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld