From aac14973aa9b9633683f6dd791983734b8ba959c Mon Sep 17 00:00:00 2001 From: "buildbot@webrtc.org" Date: Mon, 14 Jul 2014 20:22:21 +0000 Subject: [PATCH] (Auto)update libjingle 71116846-> 71117224 git-svn-id: http://webrtc.googlecode.com/svn/trunk@6680 4adac7df-926f-26a2-2b94-8c16560cd09d --- talk/base/thread.cc | 34 +--------------------------------- talk/base/thread.h | 25 ------------------------- 2 files changed, 1 insertion(+), 58 deletions(-) diff --git a/talk/base/thread.cc b/talk/base/thread.cc index 3acd9a813..87e4ffff6 100644 --- a/talk/base/thread.cc +++ b/talk/base/thread.cc @@ -142,16 +142,6 @@ struct ThreadInit { Runnable* runnable; }; -Thread::ScopedDisallowBlockingCalls::ScopedDisallowBlockingCalls() - : thread_(Thread::Current()), - previous_state_(thread_->SetAllowBlockingCalls(false)) { -} - -Thread::ScopedDisallowBlockingCalls::~ScopedDisallowBlockingCalls() { - ASSERT(thread_->IsCurrent()); - thread_->SetAllowBlockingCalls(previous_state_); -} - Thread::Thread(SocketServer* ss) : MessageQueue(ss), priority_(PRIORITY_NORMAL), @@ -160,8 +150,7 @@ Thread::Thread(SocketServer* ss) thread_(NULL), thread_id_(0), #endif - owned_(true), - blocking_calls_allowed_(true) { + owned_(true) { SetName("Thread", this); // default name } @@ -171,8 +160,6 @@ Thread::~Thread() { } bool Thread::SleepMs(int milliseconds) { - AssertBlockingIsAllowedOnCurrentThread(); - #ifdef WIN32 ::Sleep(milliseconds); return true; @@ -306,8 +293,6 @@ bool Thread::Start(Runnable* runnable) { } void Thread::Join() { - AssertBlockingIsAllowedOnCurrentThread(); - if (running()) { ASSERT(!IsCurrent()); #if defined(WIN32) @@ -323,21 +308,6 @@ void Thread::Join() { } } -bool Thread::SetAllowBlockingCalls(bool allow) { - ASSERT(IsCurrent()); - bool previous = blocking_calls_allowed_; - blocking_calls_allowed_ = allow; - return previous; -} - -// static -void Thread::AssertBlockingIsAllowedOnCurrentThread() { -#ifdef _DEBUG - Thread* current = Thread::Current(); - ASSERT(!current || current->blocking_calls_allowed_); -#endif -} - #ifdef WIN32 // As seen on MSDN. // http://msdn.microsoft.com/en-us/library/xcb2z8hs(VS.71).aspx @@ -404,8 +374,6 @@ void Thread::Stop() { } void Thread::Send(MessageHandler *phandler, uint32 id, MessageData *pdata) { - AssertBlockingIsAllowedOnCurrentThread(); - if (fStop_) return; diff --git a/talk/base/thread.h b/talk/base/thread.h index ef9786293..4cbf721fa 100644 --- a/talk/base/thread.h +++ b/talk/base/thread.h @@ -125,19 +125,6 @@ class Thread : public MessageQueue { static Thread* Current(); - // Used to catch performance regressions. Use this to disallow blocking calls - // (Invoke) for a given scope. If a synchronous call is made while this is in - // effect, an assert will be triggered. - // Note that this is a single threaded class. - class ScopedDisallowBlockingCalls { - public: - ScopedDisallowBlockingCalls(); - ~ScopedDisallowBlockingCalls(); - private: - Thread* const thread_; - const bool previous_state_; - }; - bool IsCurrent() const { return Current() == this; } @@ -178,11 +165,8 @@ class Thread : public MessageQueue { // Uses Send() internally, which blocks the current thread until execution // is complete. // Ex: bool result = thread.Invoke(&MyFunctionReturningBool); - // NOTE: This function can only be called when synchronous calls are allowed. - // See ScopedDisallowBlockingCalls for details. template ReturnT Invoke(const FunctorT& functor) { - AssertBlockingIsAllowedOnCurrentThread(); FunctorMessageHandler handler(functor); Send(&handler); return handler.result(); @@ -245,14 +229,6 @@ class Thread : public MessageQueue { // Blocks the calling thread until this thread has terminated. void Join(); - // Sets the per-thread allow-blocking-calls flag and returns the previous - // value. - bool SetAllowBlockingCalls(bool allow); - - static void AssertBlockingIsAllowedOnCurrentThread(); - - friend class ScopedDisallowBlockingCalls; - private: static void *PreRun(void *pv); @@ -279,7 +255,6 @@ class Thread : public MessageQueue { #endif bool owned_; - bool blocking_calls_allowed_; // By default set to |true|. friend class ThreadManager;