您的位置:首页 > 编程语言 > PHP开发

Jrtplib学习分析与记录5.3

2010-12-30 18:36 399 查看
Rtppollthread.cpp

void RTPPollThread::Stop()
{
if (!IsRunning())
return;

stopmutex.Lock();
stop = true;
stopmutex.Unlock();

if (transmitter)
transmitter->AbortWait();

RTPTime thetime = RTPTime::CurrentTime();
bool done = false;

while (JThread::IsRunning() && !done)
{
// wait max 5 sec
RTPTime curtime = RTPTime::CurrentTime();
if ((curtime.GetDouble()-thetime.GetDouble()) > 5.0)
done = true;
RTPTime::Wait(RTPTime(0,10000));
}

if (JThread::IsRunning())
{
#ifndef _WIN32_WCE
//		std::cerr << "RTPPollThread: Warning! Having to kill thread!" << std::endl;
LOGE("RTPPollThread: Warning! Having to kill thread!");
#endif // _WIN32_WCE
JThread::Kill();
}
stop = false;
transmitter = 0;
}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: