diff options
author | thestig@chromium.org <thestig@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-08-05 22:36:04 +0000 |
---|---|---|
committer | thestig@chromium.org <thestig@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-08-05 22:36:04 +0000 |
commit | e7af596810a247bcee52927d3e4c6a02d38e9459 (patch) | |
tree | 8b3d56e0d599daf88eaae67f0fac75781ba34768 /base/tracked_objects.h | |
parent | df9e8cd83f062e899b2952a6fa5a47b28cd8169b (diff) | |
download | chromium_src-e7af596810a247bcee52927d3e4c6a02d38e9459.zip chromium_src-e7af596810a247bcee52927d3e4c6a02d38e9459.tar.gz chromium_src-e7af596810a247bcee52927d3e4c6a02d38e9459.tar.bz2 |
FBTF: Move some inner classes out of their header files.
BUG=none
TEST=none
Review URL: http://codereview.chromium.org/3005047
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@55145 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/tracked_objects.h')
-rw-r--r-- | base/tracked_objects.h | 41 |
1 files changed, 3 insertions, 38 deletions
diff --git a/base/tracked_objects.h b/base/tracked_objects.h index 0b672ba..5392b9a 100644 --- a/base/tracked_objects.h +++ b/base/tracked_objects.h @@ -558,44 +558,9 @@ class ThreadData { SHUTDOWN, }; - // A class used to count down which is accessed by several threads. This is - // used to make sure RunOnAllThreads() actually runs a task on the expected - // count of threads. - class ThreadSafeDownCounter { - public: - // Constructor sets the count, once and for all. - explicit ThreadSafeDownCounter(size_t count); - - // Decrement the count, and return true if we hit zero. Also delete this - // instance automatically when we hit zero. - bool LastCaller(); - - private: - size_t remaining_count_; - Lock lock_; // protect access to remaining_count_. - }; - -#ifdef OS_WIN - // A Task class that runs a static method supplied, and checks to see if this - // is the last tasks instance (on last thread) that will run the method. - // IF this is the last run, then the supplied event is signalled. - class RunTheStatic : public Task { - public: - typedef void (*FunctionPointer)(); - RunTheStatic(FunctionPointer function, - HANDLE completion_handle, - ThreadSafeDownCounter* counter); - // Run the supplied static method, and optionally set the event. - void Run(); - - private: - FunctionPointer function_; - HANDLE completion_handle_; - // Make sure enough tasks are called before completion is signaled. - ThreadSafeDownCounter* counter_; - - DISALLOW_COPY_AND_ASSIGN(RunTheStatic); - }; +#if defined(OS_WIN) + class ThreadSafeDownCounter; + class RunTheStatic; #endif // Each registered thread is called to set status_ to SHUTDOWN. |