diff options
author | buildbot@webrtc.org <buildbot@webrtc.org@4adac7df-926f-26a2-2b94-8c16560cd09d> | 2014-05-23 23:13:35 +0000 |
---|---|---|
committer | buildbot@webrtc.org <buildbot@webrtc.org@4adac7df-926f-26a2-2b94-8c16560cd09d> | 2014-05-23 23:13:35 +0000 |
commit | 11c96549a8334b088ea34a6f68bb293c2a3f2ec9 (patch) | |
tree | 311b05e941360589fbeca233c2937f7d5e70bdac /examples | |
parent | 7dcbdc4b1bebf8cff340e248f318976967a6a6ed (diff) | |
download | talk-11c96549a8334b088ea34a6f68bb293c2a3f2ec9.tar.gz |
(Auto)update libjingle 67869540-> 67872893
git-svn-id: http://webrtc.googlecode.com/svn/trunk/talk@6243 4adac7df-926f-26a2-2b94-8c16560cd09d
Diffstat (limited to 'examples')
-rw-r--r-- | examples/call/console.cc | 12 | ||||
-rw-r--r-- | examples/call/console.h | 1 |
2 files changed, 9 insertions, 4 deletions
diff --git a/examples/call/console.cc b/examples/call/console.cc index 9ad8bc7..992d056 100644 --- a/examples/call/console.cc +++ b/examples/call/console.cc @@ -48,28 +48,29 @@ static void DoNothing(int unused) {} Console::Console(talk_base::Thread *thread, CallClient *client) : client_(client), client_thread_(thread), - console_thread_(new talk_base::Thread()) {} + stopped_(false) {} Console::~Console() { Stop(); } void Console::Start() { - if (!console_thread_) { + if (stopped_) { // stdin was closed in Stop(), so we can't restart. LOG(LS_ERROR) << "Cannot re-start"; return; } - if (console_thread_->started()) { + if (console_thread_) { LOG(LS_WARNING) << "Already started"; return; } + console_thread_.reset(new talk_base::Thread()); console_thread_->Start(); console_thread_->Post(this, MSG_START); } void Console::Stop() { - if (console_thread_ && console_thread_->started()) { + if (console_thread_) { #ifdef WIN32 CloseHandle(GetStdHandle(STD_INPUT_HANDLE)); #else @@ -80,6 +81,7 @@ void Console::Stop() { #endif console_thread_->Stop(); console_thread_.reset(); + stopped_ = true; } } @@ -165,3 +167,5 @@ void Console::OnMessage(talk_base::Message *msg) { break; } } + +} diff --git a/examples/call/console.h b/examples/call/console.h index 5896038..f0f36e3 100644 --- a/examples/call/console.h +++ b/examples/call/console.h @@ -64,6 +64,7 @@ class Console : public talk_base::MessageHandler { CallClient *client_; talk_base::Thread *client_thread_; talk_base::scoped_ptr<talk_base::Thread> console_thread_; + bool stopped_; }; #endif // TALK_EXAMPLES_CALL_CONSOLE_H_ |