From 08712c353f0e36ed1c0fd55ff369ca899d1bc9c5 Mon Sep 17 00:00:00 2001 From: Steve Block Date: Thu, 13 Oct 2011 11:22:45 +0100 Subject: Remove temporary debug logging - DO NOT MERGE Bug: 5244039 Change-Id: Ia383537b83933da362f4c7c7eba4b4886bce4ed5 --- base/synchronization/waitable_event_posix.cc | 9 ----- base/threading/thread.cc | 59 ---------------------------- base/threading/thread.h | 6 --- 3 files changed, 74 deletions(-) diff --git a/base/synchronization/waitable_event_posix.cc b/base/synchronization/waitable_event_posix.cc index 640026b..ae03ead 100644 --- a/base/synchronization/waitable_event_posix.cc +++ b/base/synchronization/waitable_event_posix.cc @@ -150,16 +150,7 @@ class SyncWaiter : public WaitableEvent::Waiter { }; bool WaitableEvent::Wait() { -#if defined(ANDROID) - // For debugging. See http://b/5244039 - bool result = TimedWait(TimeDelta::FromSeconds(-1)); - if (!result) { - LOG(INFO) << "TimedWait() with infinite timeout should never fail!"; - } - return result; -#else return TimedWait(TimeDelta::FromSeconds(-1)); -#endif } bool WaitableEvent::TimedWait(const TimeDelta& max_time) { diff --git a/base/threading/thread.cc b/base/threading/thread.cc index ea81644..7a100ca 100644 --- a/base/threading/thread.cc +++ b/base/threading/thread.cc @@ -53,10 +53,6 @@ Thread::Thread(const char* name) message_loop_(NULL), thread_id_(kInvalidThreadId), name_(name) { -#if defined(ANDROID) - // For debugging. See http://b/5244039 - is_starting_ = false; -#endif } Thread::~Thread() { @@ -64,33 +60,15 @@ Thread::~Thread() { } bool Thread::Start() { -#if defined(ANDROID) - // For debugging. See http://b/5244039 - LOG(INFO) << "Start(), this=" << this << ", name_=" << name_; -#endif return StartWithOptions(Options()); } bool Thread::StartWithOptions(const Options& options) { DCHECK(!message_loop_); -#if defined(ANDROID) - // For debugging. See http://b/5244039 - LOG(INFO) << "StartWithOptions(), this=" << this << ", name_=" << name_; - is_starting_lock_.Acquire(); - CHECK(!is_starting_); - is_starting_ = true; - is_starting_lock_.Release(); -#endif - SetThreadWasQuitProperly(false); StartupData startup_data(options); -#if defined(ANDROID) - // For debugging. See http://b/5244039 - LOG(INFO) << "StartWithOptions() created startup_data, this=" << this - << ", name_=" << name_; -#endif startup_data_ = &startup_data; if (!PlatformThread::Create(options.stack_size, this, &thread_)) { @@ -100,40 +78,17 @@ bool Thread::StartWithOptions(const Options& options) { } // Wait for the thread to start and initialize message_loop_ -#if defined(ANDROID) - // For debugging. See http://b/5244039 - LOG(INFO) << "StartWithOptions() waiting for thread to start, this=" << this - << ", name_=" << name_; -#endif startup_data.event.Wait(); // set it to NULL so we don't keep a pointer to some object on the stack. -#if defined(ANDROID) - // For debugging. See http://b/5244039 - LOG(INFO) << "StartWithOptions() clearing startup_data_, this=" << this - << ", name_=" << name_; - startup_data_ = reinterpret_cast(0xbbadbeef); -#else startup_data_ = NULL; -#endif started_ = true; -#if defined(ANDROID) - // For debugging. See http://b/5244039 - is_starting_lock_.Acquire(); - is_starting_ = false; - is_starting_lock_.Release(); -#endif - DCHECK(message_loop_); return true; } void Thread::Stop() { -#if defined(ANDROID) - // For debugging. See http://b/5244039 - LOG(INFO) << "Stop(), this=" << this << ", name_=" << name_; -#endif if (!thread_was_started()) return; @@ -153,10 +108,6 @@ void Thread::Stop() { started_ = false; stopping_ = false; -#if defined(ANDROID) - // For debugging. See http://b/5244039 - LOG(INFO) << "Stop() done, this=" << this << ", name_=" << name_; -#endif } void Thread::StopSoon() { @@ -191,11 +142,6 @@ bool Thread::GetThreadWasQuitProperly() { void Thread::ThreadMain() { { -#if defined(ANDROID) - // For debugging. See http://b/5244039 - LOG(INFO) << "ThreadMain() starting, this=" << this - << ", name_=" << name_; -#endif // The message loop for this thread. MessageLoop message_loop(startup_data_->options.message_loop_type); @@ -211,11 +157,6 @@ void Thread::ThreadMain() { // Let's do this before signaling we are started. Init(); -#if defined(ANDROID) - // For debugging. See http://b/5244039 - LOG(INFO) << "ThreadMain() signalling, this=" << this - << ", name_=" << name_; -#endif startup_data_->event.Signal(); // startup_data_ can't be touched anymore since the starting thread is now // unlocked. diff --git a/base/threading/thread.h b/base/threading/thread.h index c3516e7..034cb7d 100644 --- a/base/threading/thread.h +++ b/base/threading/thread.h @@ -185,12 +185,6 @@ class BASE_API Thread : PlatformThread::Delegate { // The name of the thread. Used for debugging purposes. std::string name_; -#if defined(ANDROID) - // For debugging. See http://b/5244039 - Lock is_starting_lock_; - bool is_starting_; -#endif - friend class ThreadQuitTask; DISALLOW_COPY_AND_ASSIGN(Thread); -- cgit v1.1