File tree Expand file tree Collapse file tree 1 file changed +14
-3
lines changed Expand file tree Collapse file tree 1 file changed +14
-3
lines changed Original file line number Diff line number Diff line change @@ -86,9 +86,13 @@ class CScheduler
8686
8787/* *
8888 * Class used by CScheduler clients which may schedule multiple jobs
89- * which are required to be run serially. Does not require such jobs
90- * to be executed on the same thread, but no two jobs will be executed
91- * at the same time.
89+ * which are required to be run serially. Jobs may not be run on the
90+ * same thread, but no two jobs will be executed
91+ * at the same time and memory will be release-acquire consistent
92+ * (the scheduler will internally do an acquire before invoking a callback
93+ * as well as a release at the end). In practice this means that a callback
94+ * B() will be able to observe all of the effects of callback A() which executed
95+ * before it.
9296 */
9397class SingleThreadedSchedulerClient {
9498private:
@@ -103,6 +107,13 @@ class SingleThreadedSchedulerClient {
103107
104108public:
105109 explicit SingleThreadedSchedulerClient (CScheduler *pschedulerIn) : m_pscheduler(pschedulerIn) {}
110+
111+ /* *
112+ * Add a callback to be executed. Callbacks are executed serially
113+ * and memory is sequentially consistent between callback executions.
114+ * Practially, this means that callbacks can behave as if they are executed
115+ * in order by a single thread.
116+ */
106117 void AddToProcessQueue (std::function<void (void )> func);
107118
108119 // Processes all remaining queue members on the calling thread, blocking until queue is empty
You can’t perform that action at this time.
0 commit comments