@@ -140,22 +140,23 @@ class TaskQueue : public AbstractThread, public nsIDirectTaskDispatcher {
140140 }
141141 }
142142
143- nsCOMPtr<nsIEventTarget> mTarget ;
143+ nsCOMPtr<nsIEventTarget> mTarget GUARDED_BY ( mQueueMonitor ) ;
144144
145145 // Monitor that protects the queue, mIsRunning, mIsShutdown and
146146 // mShutdownTasks;
147- Monitor mQueueMonitor MOZ_UNANNOTATED ;
147+ Monitor mQueueMonitor ;
148148
149149 typedef struct TaskStruct {
150150 nsCOMPtr<nsIRunnable> event;
151151 uint32_t flags;
152152 } TaskStruct;
153153
154154 // Queue of tasks to run.
155- Queue<TaskStruct> mTasks ;
155+ Queue<TaskStruct> mTasks GUARDED_BY ( mQueueMonitor ) ;
156156
157157 // List of tasks to run during shutdown.
158- nsTArray<nsCOMPtr<nsITargetShutdownTask>> mShutdownTasks ;
158+ nsTArray<nsCOMPtr<nsITargetShutdownTask>> mShutdownTasks
159+ GUARDED_BY (mQueueMonitor );
159160
160161 // The thread currently running the task queue. We store a reference
161162 // to this so that IsCurrentThreadIn() can tell if the current thread
@@ -207,11 +208,11 @@ class TaskQueue : public AbstractThread, public nsIDirectTaskDispatcher {
207208
208209 // True if we've dispatched an event to the target to execute events from
209210 // the queue.
210- bool mIsRunning ;
211+ bool mIsRunning GUARDED_BY ( mQueueMonitor ) ;
211212
212213 // True if we've started our shutdown process.
213- bool mIsShutdown ;
214- MozPromiseHolder<ShutdownPromise> mShutdownPromise ;
214+ bool mIsShutdown GUARDED_BY ( mQueueMonitor ) ;
215+ MozPromiseHolder<ShutdownPromise> mShutdownPromise GUARDED_BY ( mQueueMonitor ) ;
215216
216217 // The name of this TaskQueue. Useful when debugging dispatch failures.
217218 const char * const mName ;
0 commit comments