1.

void TCPServer::start()

{

poco_assert (_stopped);

_stopped = false;

_thread.start(*this);

}

void Thread::start(Runnable& target)
{
startImpl(target);
} ... void ThreadImpl::startImpl(Runnable& target)
{
if (_pData->pRunnableTarget)
throw SystemException("thread already running"); pthread_attr_t attributes;
pthread_attr_init(&attributes); if (_pData->stackSize != )
{
if ( != pthread_attr_setstacksize(&attributes, _pData->stackSize))
{
pthread_attr_destroy(&attributes);
throw SystemException("cannot set thread stack size");
}
} _pData->pRunnableTarget = ⌖
if (pthread_create(&_pData->thread, &attributes, runnableEntry, this))
{
_pData->pRunnableTarget = ;
pthread_attr_destroy(&attributes);
throw SystemException("cannot start thread");
}
pthread_attr_destroy(&attributes); if (_pData->policy == SCHED_OTHER)
{
if (_pData->prio != PRIO_NORMAL_IMPL)
{
struct sched_param par;
par.sched_priority = mapPrio(_pData->prio, SCHED_OTHER);
if (pthread_setschedparam(_pData->thread, SCHED_OTHER, &par))
throw SystemException("cannot set thread priority");
}
}
else
{
struct sched_param par;
par.sched_priority = mapPrio(_pData->prio, _pData->policy);
if (pthread_setschedparam(_pData->thread, _pData->policy, &par))
throw SystemException("cannot set thread priority");
}
}
... void* ThreadImpl::runnableEntry(void* pThread)
{
_currentThreadHolder.set(reinterpret_cast<ThreadImpl*>(pThread)); #if defined(POCO_OS_FAMILY_UNIX)
sigset_t sset;
sigemptyset(&sset);
sigaddset(&sset, SIGQUIT);
sigaddset(&sset, SIGTERM);
sigaddset(&sset, SIGPIPE);
pthread_sigmask(SIG_BLOCK, &sset, );
#endif ThreadImpl* pThreadImpl = reinterpret_cast<ThreadImpl*>(pThread);
AutoPtr<ThreadData> pData = pThreadImpl->_pData;
try
{
pData->pRunnableTarget->run();
}
catch (Exception& exc)
{
ErrorHandler::handle(exc);
}
catch (std::exception& exc)
{
ErrorHandler::handle(exc);
}
catch (...)
{
ErrorHandler::handle();
} pData->pRunnableTarget = ;
pData->done.set();
return ;
}

https://codeload.github.com/JetMeta/ZPoco/zip/master

第16月第10天 poco target的更多相关文章

  1. 第10月第10天 git

    1. 已经用 git commit  提交了代码. 此命令可以用来回退到任意版本:git reset --hard  commitid https://www.cnblogs.com/qufanblo ...

  2. ubuntu 16.04(Windows 10双系统+grub引导)无法进入tt1~tt6(NVIDIA驱动安装相关-黑屏,login loop,分辨率)

    目录 前言回顾 最终解决: 0.关闭x服务 1.禁用nouveau 2.加入 3.更新 4.查找匹配驱动 5.选择推荐版本 6.等待安装后重启,nvidia-smi查看是否安装成功,或者lsmod | ...

  3. 薅羊毛? 月入10万? | 这是自动化测试老司机的特长--Python自动化带你薅视频红包,一个都不放过!

    一.目标场景 如今短视频横行的时代,以某短视频为首的,背后依靠着强大的资金后盾,疯狂地对平台用户进行红包轰炸. ​ 与传统的红包不一样,视频红包包含位置的不确定性.大小不确定性.元素 ID 的不确定性 ...

  4. 第16月第12天 CABasicAnimation 旋转加速

    1. ; double duration = 10.0f; ; i<count; i++) { //旋转动画 CABasicAnimation *anima3 = [CABasicAnimati ...

  5. 第16月第8天 NSInvocation存储 函数指针 va_arg lldb

    1.NSInvocation存储 -(void)setInvok:(id)target sel:(SEL)sel key:(id)key { if(!target) return; NSMethodS ...

  6. LeetCode 16 3Sum Closest (最接近target的3个数之和)

    题目链接 https://leetcode.com/problems/3sum-closest/?tab=Description     Problem : 找到给定数组中a+b+c 最接近targe ...

  7. Ubuntu 14.04 16.04 17.10 + Win10 双系统安装记录 + 分区大小选择办法

    安装了N遍,重要的东西在此记录. 参考了 http://www.libinx.com/2017/five-steps-win10-ubuntu-dual-boot/ 忠告:为了让日后喘气能匀呼些,要选 ...

  8. 第31月第10天 tableview头部空白 Other Linker Flags rtmp

    1.ios10 tableview头部空白 if (@available(iOS 11.0, *)) { self.tableView.contentInsetAdjustmentBehavior = ...

  9. Connect To Ubuntu 16.04 / 17.10 / 18.04 Desktop Via Remote Desktop Connection (RDP) With Xrdp

    [1] https://websiteforstudents.com/connect-to-ubuntu-16-04-17-10-18-04-desktop-via-remote-desktop-co ...

随机推荐

  1. Highcharts之3D柱状图

    <!DOCTYPE html> <html> <head> <meta http-equiv="Content-Type" content ...

  2. Spark_RDD之基本RDD操作

    1.基本转化操作    1.1最常用的两个转化操作时map()和filter(). map()接收一个函数,把这个函数用于RDD中的每个元素,将函数作用之后的结果作为结果RDD中元素的值. filte ...

  3. JS通过键盘点击事件实现div移动

    页面内容:文本框模拟键盘点击   div元素实现移动: <body> <textarea id="myarea"></textarea> < ...

  4. MT【72】一个不等式

    证明: 评: 可以思考$\frac{1}{(1+b)^2}+\frac{1}{(1+a)^2}$与$\frac{2}{(1+\sqrt{ab})^2}$大小.

  5. MT【55】近零点

    [Among the natural enemy of mathematics, the most important thing is that how do we konw     somethi ...

  6. 小强学Python+OpenCV之-1.3绘图

    目标 今天的课程比较轻松,我们来学习一下OpenCV中几个绘图函数: cv2.line cv2.rectangle cv2.circle 画直线 直接经过前面两节的内容.我想直接上代码应该是可以接受的 ...

  7. HGOI 20190218 题解

    /* 又是AK局... hjc又双叒叕AK了... Hmmm...我侥幸 */ Problem A card 给出无序序列a[]可以选择一个数插入到合适的位置作为一次操作,至少多少次操作后可以把序列变 ...

  8. SharePoint 2013 批量导入、删除帐号

    删除一个group里所有的帐号: cls ########################### # "Enter the site URL here" $SITEURL = &q ...

  9. 【转】用宏定义代替printf函数

    问题提出 有时候我们想用宏定义来决定是编译debug版本的代码还是release的代码,dubug版本的代码会通过printf打印调试信息,release版本的代码则不会.我们总不能对每一条print ...

  10. 爬楼梯问题 leetcode70

    假设你正在爬楼梯,需要n阶你才能到达楼顶,n是正整数 每次你可以爬1或2个台阶,有多少种不同的方法可以爬到楼顶 当n=1时,steps=1 当n=2时,1+1,2 steps=2 当n=3时,1+1+ ...