summaryrefslogtreecommitdiffstats
path: root/base/threading
diff options
context:
space:
mode:
authorwez@chromium.org <wez@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-10-10 03:56:12 +0000
committerwez@chromium.org <wez@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-10-10 03:56:12 +0000
commitb35254d80932c7a1be75e2a6f271219929a8a3be (patch)
treef2b7065cb8499e088c73e56aafc091e461139f31 /base/threading
parent42eadc92b2656fe21c3228f4432d28ddac36c6bd (diff)
downloadchromium_src-b35254d80932c7a1be75e2a6f271219929a8a3be.zip
chromium_src-b35254d80932c7a1be75e2a6f271219929a8a3be.tar.gz
chromium_src-b35254d80932c7a1be75e2a6f271219929a8a3be.tar.bz2
Initial implementation of AutoThread.
AutoThreads work much like base::Threads with the difference that the AutoThread will run until the last reference to its TaskRunner has been dropped. When the owner deletes the AutoThread they will be blocked until the thread is ready to be joined. AutoThread simplifies teardown of multi-threaded code by ensuring that threads persist until no code remains that may need to use them. BUG=145856 Review URL: https://chromiumcodereview.appspot.com/10919081 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@161030 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/threading')
-rw-r--r--base/threading/thread_restrictions.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/base/threading/thread_restrictions.h b/base/threading/thread_restrictions.h
index acc1b21..3effc9c 100644
--- a/base/threading/thread_restrictions.h
+++ b/base/threading/thread_restrictions.h
@@ -60,6 +60,10 @@ class FileStreamWin;
class NetworkManagerApi;
}
+namespace remoting {
+class AutoThread;
+}
+
namespace base {
class SequencedWorkerPool;
@@ -164,10 +168,12 @@ class BASE_EXPORT ThreadRestrictions {
friend class ::HistogramSynchronizer;
friend class ::ScopedAllowWaitForLegacyWebViewApi;
friend class ::TestingAutomationProvider;
+ friend class remoting::AutoThread;
friend class SequencedWorkerPool;
friend class SimpleThread;
friend class Thread;
friend class ThreadTestHelper;
+
// END ALLOWED USAGE.
// BEGIN USAGE THAT NEEDS TO BE FIXED.
friend class ::chromeos::AudioMixerAlsa; // http://crbug.com/125206