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 @@ -87,9 +87,13 @@ class CScheduler
8787
8888/* *
8989 * Class used by CScheduler clients which may schedule multiple jobs
90- * which are required to be run serially. Does not require such jobs
91- * to be executed on the same thread, but no two jobs will be executed
92- * at the same time.
90+ * which are required to be run serially. Jobs may not be run on the
91+ * same thread, but no two jobs will be executed
92+ * at the same time and memory will be release-acquire consistent
93+ * (the scheduler will internally do an acquire before invoking a callback
94+ * as well as a release at the end). In practice this means that a callback
95+ * B() will be able to observe all of the effects of callback A() which executed
96+ * before it.
9397 */
9498class SingleThreadedSchedulerClient {
9599private:
@@ -104,6 +108,13 @@ class SingleThreadedSchedulerClient {
104108
105109public:
106110 explicit SingleThreadedSchedulerClient (CScheduler *pschedulerIn) : m_pscheduler(pschedulerIn) {}
111+
112+ /* *
113+ * Add a callback to be executed. Callbacks are executed serially
114+ * and memory is release-acquire consistent between callback executions.
115+ * Practially, this means that callbacks can behave as if they are executed
116+ * in order by a single thread.
117+ */
107118 void AddToProcessQueue (std::function<void (void )> func);
108119
109120 // 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