diff options
author | agl@chromium.org <agl@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-12-16 21:23:56 +0000 |
---|---|---|
committer | agl@chromium.org <agl@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-12-16 21:23:56 +0000 |
commit | 6009dc01772c79b4e964fbdf07dada473c821555 (patch) | |
tree | d144bfa70e9cd88edd1585be6d8e45b767c4328a | |
parent | 706d96bd103cd0850f3eb594b75d4823a08240c9 (diff) | |
download | chromium_src-6009dc01772c79b4e964fbdf07dada473c821555.zip chromium_src-6009dc01772c79b4e964fbdf07dada473c821555.tar.gz chromium_src-6009dc01772c79b4e964fbdf07dada473c821555.tar.bz2 |
Revert "Protect reading and writing startup_data_"
This reverts commit r69438. It may have broken Linux dbg-shlib.
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@69466 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | base/thread.cc | 19 | ||||
-rw-r--r-- | base/thread.h | 2 |
2 files changed, 3 insertions, 18 deletions
diff --git a/base/thread.cc b/base/thread.cc index a6b4986..bc715f0 100644 --- a/base/thread.cc +++ b/base/thread.cc @@ -81,13 +81,7 @@ bool Thread::StartWithOptions(const Options& options) { SetThreadWasQuitProperly(false); StartupData startup_data(options); - { - // Use a lock to force instruction order on SMP architectures. On SMP - // machines, the assignment of startup_data_ may be moved after creation of - // the thread and possibly after the new thread attempts to use it. - AutoLock lock(startup_data_lock_); - startup_data_ = &startup_data; - } + startup_data_ = &startup_data; if (!PlatformThread::Create(options.stack_size, this, &thread_)) { DLOG(ERROR) << "failed to create thread"; @@ -148,15 +142,8 @@ void Thread::Run(MessageLoop* message_loop) { void Thread::ThreadMain() { { - StartupData* startup_data = NULL; - { - // Use a lock to ensure that startup_data_ has been written before we - // access it here. - AutoLock lock(startup_data_lock_); - startup_data = startup_data_; - } // The message loop for this thread. - MessageLoop message_loop(startup_data->options.message_loop_type); + MessageLoop message_loop(startup_data_->options.message_loop_type); // Complete the initialization of our Thread object. thread_id_ = PlatformThread::CurrentId(); @@ -170,7 +157,7 @@ void Thread::ThreadMain() { // Let's do this before signaling we are started. Init(); - startup_data->event.Signal(); + startup_data_->event.Signal(); // 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 12ec4d2..fc542f0 100644 --- a/base/thread.h +++ b/base/thread.h @@ -8,7 +8,6 @@ #include <string> -#include "base/lock.h" #include "base/message_loop.h" #include "base/message_loop_proxy.h" #include "base/platform_thread.h" @@ -166,7 +165,6 @@ class Thread : PlatformThread::Delegate { bool stopping_; // Used to pass data to ThreadMain. - Lock startup_data_lock_; struct StartupData; StartupData* startup_data_; |