void ThreadImpl::startImpl(Runnable& target) { if (isRunningImpl()) throw SystemException("thread already running"); _pRunnableTarget = ⌖ createImpl(runnableEntry, this); }
void ThreadImpl::startImpl(Callable target, void* pData) { if (isRunningImpl()) throw SystemException("thread already running"); _callbackTarget.callback = target; _callbackTarget.pData = pData; createImpl(callableEntry, this); }
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"); } } }
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"); } } }
bool Process::isRunning(PID pid) { return isRunningImpl(pid); }
bool Process::isRunning(const ProcessHandle& handle) { return isRunningImpl(*handle._pImpl); }
ThreadImpl::~ThreadImpl() { if (isRunningImpl()) pthread_detach(_pData->thread); }
bool ProcessImpl::isRunningImpl(const ProcessHandleImpl& handle) { return isRunningImpl(handle.id()); }