summaryrefslogtreecommitdiffstats
path: root/base/thread.cc
diff options
context:
space:
mode:
authorjrg@chromium.org <jrg@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-01-22 19:27:13 +0000
committerjrg@chromium.org <jrg@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-01-22 19:27:13 +0000
commitf1cbc4644f1c41954e5f3562d723a471139ff465 (patch)
tree937b744ca37c95105eb81663f9049e8ca3c27e9f /base/thread.cc
parent89ca511940175e66299235af11ae5c1cd24bc7f4 (diff)
downloadchromium_src-f1cbc4644f1c41954e5f3562d723a471139ff465.zip
chromium_src-f1cbc4644f1c41954e5f3562d723a471139ff465.tar.gz
chromium_src-f1cbc4644f1c41954e5f3562d723a471139ff465.tar.bz2
Moved Init() startup_data_->event.Signal() because derived classes may
not be safe to use until Init() has been called. As an example, RenderThread() creates it's IPC::SyncChannel in Init(), so it isn't safe to call Send() method until after. Change tested explicitly on Mac Win Linux. Review URL: http://codereview.chromium.org/18508 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@8485 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/thread.cc')
-rw-r--r--base/thread.cc7
1 files changed, 4 insertions, 3 deletions
diff --git a/base/thread.cc b/base/thread.cc
index 9bc81a4..387b1c5 100644
--- a/base/thread.cc
+++ b/base/thread.cc
@@ -143,13 +143,14 @@ void Thread::ThreadMain() {
message_loop.set_thread_name(name_);
message_loop_ = &message_loop;
+ // Let the thread do extra initialization.
+ // Let's do this before signaling we are started.
+ Init();
+
startup_data_->event.Signal();
// startup_data_ can't be touched anymore since the starting thread is now
// unlocked.
- // Let the thread do extra initialization.
- Init();
-
message_loop.Run();
// Let the thread do extra cleanup.