예제 #1
0
void ThreadImpl::startImpl(Runnable& target)
{
	if (isRunningImpl())
		throw SystemException("thread already running");

	_pRunnableTarget = ⌖

	createImpl(runnableEntry, this);
}
예제 #2
0
void ThreadImpl::startImpl(Callable target, void* pData)
{
	if (isRunningImpl())
		throw SystemException("thread already running");

	_callbackTarget.callback = target;
	_callbackTarget.pData = pData;

	createImpl(callableEntry, this);
}
예제 #3
0
void ThreadImpl::setPriorityImpl(int prio) {
    if (prio != _pData->prio) {
        _pData->prio = prio;
        _pData->policy = SCHED_OTHER;
        if (isRunningImpl()) {
            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");
        }
    }
}
예제 #4
0
파일: Thread_VX.cpp 프로젝트: as2120/ZPoco
void ThreadImpl::setPriorityImpl(int prio)
{
    if (prio != _pData->prio)
    {
        _pData->prio   = prio;
        _pData->osPrio = mapPrio(_pData->prio);
        if (isRunningImpl())
        {
            if (taskPrioritySet(_pData->task, _pData->osPrio) != OK)
                throw SystemException("cannot set task priority");
        }
    }
}
예제 #5
0
bool Process::isRunning(PID pid)
{
	return isRunningImpl(pid);
}
예제 #6
0
bool Process::isRunning(const ProcessHandle& handle)
{
	return isRunningImpl(*handle._pImpl);
}
예제 #7
0
파일: Thread_POSIX.cpp 프로젝트: 119/vdc
ThreadImpl::~ThreadImpl()
{
	if (isRunningImpl())
		pthread_detach(_pData->thread);
}
예제 #8
0
bool ProcessImpl::isRunningImpl(const ProcessHandleImpl& handle)
{
	return isRunningImpl(handle.id());
}