diff options
Diffstat (limited to 'chromium/base/message_loop/incoming_task_queue.h')
-rw-r--r-- | chromium/base/message_loop/incoming_task_queue.h | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/chromium/base/message_loop/incoming_task_queue.h b/chromium/base/message_loop/incoming_task_queue.h index e450aa164fa..aff71d20bf8 100644 --- a/chromium/base/message_loop/incoming_task_queue.h +++ b/chromium/base/message_loop/incoming_task_queue.h @@ -10,6 +10,7 @@ #include "base/memory/ref_counted.h" #include "base/pending_task.h" #include "base/synchronization/lock.h" +#include "base/synchronization/read_write_lock.h" #include "base/time/time.h" namespace base { @@ -62,9 +63,6 @@ class BASE_EXPORT IncomingTaskQueue friend class RefCountedThreadSafe<IncomingTaskQueue>; virtual ~IncomingTaskQueue(); - // Calculates the time at which a PendingTask should run. - TimeTicks CalculateDelayedRuntime(TimeDelta delay); - // Adds a task to |incoming_queue_|. The caller retains ownership of // |pending_task|, but this function will reset the value of // |pending_task->task|. This is needed to ensure that the posting call stack @@ -78,9 +76,14 @@ class BASE_EXPORT IncomingTaskQueue // so that ReloadWorkQueue() completes in constant time. int high_res_task_count_; - // The lock that protects access to the members of this class. + // The lock that protects access to the members of this class, except + // |message_loop_|. base::Lock incoming_queue_lock_; + // Lock that protects |message_loop_| to prevent it from being deleted while a + // task is being posted. + base::subtle::ReadWriteLock message_loop_lock_; + // An incoming queue of tasks that are acquired under a mutex for processing // on this instance's thread. These tasks have not yet been been pushed to // |message_loop_|. |