check_supported_priorities.cpp
来自「这是广泛使用的通信开源项目,对于大容量,高并发的通讯要求完全能够胜任,他广泛可用」· C++ 代码 · 共 52 行
CPP
52 行
// check_supported_priorities.cpp,v 1.9 2003/08/17 17:39:53 ossama Exp
#include "ace/Sched_Params.h"
#include "tao/ORB_Core.h"
#include "tao/ORB.h"
const char *
sched_policy_name (int sched_policy)
{
const char *name = 0;
switch (sched_policy)
{
case ACE_SCHED_OTHER:
name = "SCHED_OTHER";
break;
case ACE_SCHED_RR:
name = "SCHED_RR";
break;
case ACE_SCHED_FIFO:
name = "SCHED_FIFO";
break;
}
return name;
}
void
check_supported_priorities (CORBA::ORB_ptr orb)
{
int sched_policy =
orb->orb_core ()->orb_params ()->ace_sched_policy ();
// Check that we have sufficient priority range to run this test,
// i.e., more than 1 priority level.
int max_priority =
ACE_Sched_Params::priority_max (sched_policy);
int min_priority =
ACE_Sched_Params::priority_min (sched_policy);
if (max_priority == min_priority)
{
ACE_DEBUG ((LM_DEBUG,
"Not enough priority levels with the %s scheduling policy\n"
"on this platform to run the test, terminating program....\n"
"Check svc.conf options\n",
sched_policy_name (sched_policy)));
ACE_OS::exit (2);
}
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?