diff options
author | Patrick Scott <phanna@android.com> | 2011-01-05 16:16:39 -0500 |
---|---|---|
committer | Patrick Scott <phanna@android.com> | 2011-01-05 16:18:16 -0500 |
commit | e1d613f9fecbfa93b61bba44ab49637924946251 (patch) | |
tree | db50ea06e347730d963c324ead1a23a2ab4edd43 /base | |
parent | 40eae52c5e5dbf475a0cf368c9ccbb7f8a0653f4 (diff) | |
download | external_chromium-e1d613f9fecbfa93b61bba44ab49637924946251.zip external_chromium-e1d613f9fecbfa93b61bba44ab49637924946251.tar.gz external_chromium-e1d613f9fecbfa93b61bba44ab49637924946251.tar.bz2 |
Revert "Guard startup_data_ to ensure it is set."
This reverts commit 6549a5990c7b8672bd9d216ffb55d8a7a5999cc2.
It was an incorrect fix for the underlying problem. The real fix was in webkit
where we were creating the thread. The problem was that StartWithOptions was
being called by two different threads at the same time.
Diffstat (limited to 'base')
-rw-r--r-- | base/thread.cc | 24 | ||||
-rw-r--r-- | base/thread.h | 6 |
2 files changed, 0 insertions, 30 deletions
diff --git a/base/thread.cc b/base/thread.cc index e397be6..41d78f0 100644 --- a/base/thread.cc +++ b/base/thread.cc @@ -81,16 +81,7 @@ bool Thread::StartWithOptions(const Options& options) { SetThreadWasQuitProperly(false); StartupData startup_data(options); -#ifdef ANDROID - { - // Use a lock to issue a cpu barrier and force the new thread to load - // startup_data_. - AutoLock lock(startup_data_lock_); - startup_data_ = &startup_data; - } -#else startup_data_ = &startup_data; -#endif if (!PlatformThread::Create(options.stack_size, this, &thread_)) { DLOG(ERROR) << "failed to create thread"; @@ -151,19 +142,8 @@ void Thread::Run(MessageLoop* message_loop) { void Thread::ThreadMain() { { -#ifdef ANDROID - StartupData* startup_data = NULL; - { - // Use a lock to ensure startup_data_ has been written. - AutoLock lock(startup_data_lock_); - startup_data = startup_data_; - } - // The message loop for this thread. - MessageLoop message_loop(startup_data->options.message_loop_type); -#else // The message loop for this thread. MessageLoop message_loop(startup_data_->options.message_loop_type); -#endif // Complete the initialization of our Thread object. thread_id_ = PlatformThread::CurrentId(); @@ -177,11 +157,7 @@ void Thread::ThreadMain() { // Let's do this before signaling we are started. Init(); -#ifdef ANDROID - startup_data->event.Signal(); -#else startup_data_->event.Signal(); -#endif // startup_data_ can't be touched anymore since the starting thread is now // unlocked. diff --git a/base/thread.h b/base/thread.h index 870a985..572eb8a 100644 --- a/base/thread.h +++ b/base/thread.h @@ -8,9 +8,6 @@ #include <string> -#ifdef ANDROID -#include "base/lock.h" -#endif #include "base/message_loop.h" #include "base/message_loop_proxy.h" #include "base/platform_thread.h" @@ -168,9 +165,6 @@ class Thread : PlatformThread::Delegate { bool stopping_; // Used to pass data to ThreadMain. -#ifdef ANDROID - Lock startup_data_lock_; // protects startup_data_ -#endif struct StartupData; StartupData* startup_data_; |