本文整理汇总了C++中IOWorkLoop::getThread方法的典型用法代码示例。如果您正苦于以下问题:C++ IOWorkLoop::getThread方法的具体用法?C++ IOWorkLoop::getThread怎么用?C++ IOWorkLoop::getThread使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IOWorkLoop
的用法示例。
在下文中一共展示了IOWorkLoop::getThread方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
IOWorkLoop *
IOFWUserLocalIsochPort::createRealtimeThread()
{
IOWorkLoop * workloop = IOWorkLoop::workLoop() ;
if ( workloop )
{
// Boost isoc workloop into realtime range
thread_time_constraint_policy_data_t constraints;
AbsoluteTime time;
nanoseconds_to_absolutetime(625000, &time);
constraints.period = AbsoluteTime_to_scalar(&time);
nanoseconds_to_absolutetime(60000, &time);
constraints.computation = AbsoluteTime_to_scalar(&time);
nanoseconds_to_absolutetime(1250000, &time);
constraints.constraint = AbsoluteTime_to_scalar(&time);
constraints.preemptible = TRUE;
{
IOThread thread;
thread = workloop->getThread();
thread_policy_set( thread, THREAD_TIME_CONSTRAINT_POLICY, (thread_policy_t) & constraints, THREAD_TIME_CONSTRAINT_POLICY_COUNT );
}
}
return workloop ;
}