Remove an unused Shutdown method from the ThreadWrapper interface.
The method was flagged by Chrome engineers as dubious since it uses TerminateThread. As it turns out, we don't use this method anywhere, so we can simply remove it! :) BUG=1066 Review URL: https://webrtc-codereview.appspot.com/938012 git-svn-id: http://webrtc.googlecode.com/svn/trunk@3065 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
parent
1401285fe7
commit
b952a90038
@ -88,11 +88,6 @@ public:
|
||||
// Multiple tries to Stop are allowed (e.g. to wait longer than 2 seconds).
|
||||
// It's ok to call Stop() even if the spawned thread has been reclaimed.
|
||||
virtual bool Stop() = 0;
|
||||
|
||||
// Stops the spawned thread dead in its tracks. Will likely result in a
|
||||
// corrupt state. There should be an extremely good reason for even looking
|
||||
// at this function. Can cause many problems deadlock being one of them.
|
||||
virtual bool Shutdown() {return false;}
|
||||
};
|
||||
} // namespace webrtc
|
||||
|
||||
|
||||
@ -306,20 +306,6 @@ void ThreadPosix::SetNotAlive()
|
||||
_alive = false;
|
||||
}
|
||||
|
||||
bool ThreadPosix::Shutdown()
|
||||
{
|
||||
#if !defined(WEBRTC_ANDROID)
|
||||
if (_thread && (0 != pthread_cancel(_thread)))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
#else
|
||||
return false;
|
||||
#endif
|
||||
}
|
||||
|
||||
bool ThreadPosix::Stop()
|
||||
{
|
||||
bool dead = false;
|
||||
|
||||
@ -38,7 +38,6 @@ public:
|
||||
virtual bool SetAffinity(const int* processorNumbers,
|
||||
unsigned int amountOfProcessors);
|
||||
virtual bool Stop();
|
||||
virtual bool Shutdown();
|
||||
|
||||
void Run();
|
||||
|
||||
|
||||
@ -133,20 +133,6 @@ void ThreadWindows::SetNotAlive()
|
||||
_alive = false;
|
||||
}
|
||||
|
||||
bool ThreadWindows::Shutdown()
|
||||
{
|
||||
DWORD exitCode = 0;
|
||||
BOOL ret = TRUE;
|
||||
if (_thread)
|
||||
{
|
||||
ret = TerminateThread(_thread, exitCode);
|
||||
_alive = false;
|
||||
_dead = true;
|
||||
_thread = NULL;
|
||||
}
|
||||
return ret == TRUE;
|
||||
}
|
||||
|
||||
bool ThreadWindows::Stop()
|
||||
{
|
||||
_critsectStop->Enter();
|
||||
|
||||
@ -34,8 +34,6 @@ public:
|
||||
|
||||
static unsigned int WINAPI StartThread(LPVOID lpParameter);
|
||||
|
||||
virtual bool Shutdown();
|
||||
|
||||
protected:
|
||||
virtual void Run();
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user