Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(194)

Side by Side Diff: base/single_thread_executor.h

Issue 9169037: Make new TaskRunner, SequencedTaskRunner, and SingleThreadTaskRunner interfaces (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix Win build Created 8 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef BASE_SINGLE_THREAD_EXECUTOR_H_
6 #define BASE_SINGLE_THREAD_EXECUTOR_H_
7 #pragma once
8
9 #include "base/base_export.h"
10 #include "base/serial_executor.h"
11
12 namespace base {
13
14 // A SingleThreadExecutor is a SerialExecutor with one more guarantee;
15 // namely, that all tasks are executed on a single specific thread.
16 //
17 // Some theoretical implementations of SingleThreadExecutor:
18 //
19 // - A SingleThreadExecutor that uses a single worker thread to run
20 // submitted tasks (i.e., a message loop).
21 //
22 // - A SingleThreadExecutor that stores the list of submitted tasks
23 // and has a method Run() that executes each runnable task in FIFO
24 // order that must be run only from the thread the
25 // SingleThreadExecutor was created on.
26 class BASE_EXPORT SingleThreadExecutor : public SerialExecutor {
27 public:
28 // A more explicit alias to MayRunTasksOnCurrentThread().
29 bool BelongsToCurrentThread() const {
30 return MayRunTasksOnCurrentThread();
31 }
32 };
33
34 } // namespace base
35
36 #endif // BASE_SERIAL_EXECUTOR_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698