//............................................................................ static void thread_function(void *pVoid) { // embOS signature QMActive *act = reinterpret_cast<QMActive *>(pVoid); #ifdef __TARGET_FPU_VFP // does the task use the FPU? see NOTE1 if ((act->getOsObject() & QF_TASK_USES_FPU) != static_cast<uint32_t>(0)) { OS_ExtendTaskContext_VFP(); } #endif // __TARGET_FPU_VFP QF::thread_(act); QF::remove_(act); // remove this object from QF OS_TerminateTask(&act->getThread()); }
/*..........................................................................*/ static void thread_function(void *pVoid) { /* embOS signature */ QActive *act = (QActive *)pVoid; #ifdef __TARGET_FPU_VFP /* does the task use the FPU? see NOTE1 */ if ((act->osObject & QF_TASK_USES_FPU) != (uint32_t)0) { OS_ExtendTaskContext_VFP(); } #endif /* __TARGET_FPU_VFP */ act->osObject = (uint32_t)1; /* enable the event-loop, see NOTE2 */ while (act->osObject != (uint32_t)0) { /* event-loop */ QEvt const *e = QActive_get_(act); QMSM_DISPATCH(&act->super, e); QF_gc(e); /* check if the event is garbage, and collect it if so */ } QF_remove_(act); /* remove this object from QF */ OS_DeleteMB(&act->eQueue); OS_TerminateTask(&act->thread); }
void osDeleteTask(OsTask *task) { //Delete the specified task OS_TerminateTask(task); }
void sys_thread_exit( void ) { // Terminate the current/calling task OS_TerminateTask(OS_GetpCurrentTask()); }