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
86
86
87
87
/* *
88
88
* 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.
92
96
*/
93
97
class SingleThreadedSchedulerClient {
94
98
private:
@@ -103,6 +107,13 @@ class SingleThreadedSchedulerClient {
103
107
104
108
public:
105
109
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
+ */
106
117
void AddToProcessQueue (std::function<void (void )> func);
107
118
108
119
// 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