Lines Matching refs:task_handler
81 OSI_STATE OSI_task_run(tOSI_TASK_HANDLER task_handler) { in OSI_task_run() argument
86 if (!task_handler) { in OSI_task_run()
88 } else if (task_handler->state != OSI_ALLOCATED) { in OSI_task_run()
90 task_handler->state); in OSI_task_run()
94 if (!pthread_create(&(task_handler->task), &attr, in OSI_task_run()
96 (void*)(task_handler->task_entry))) { // in OSI_task_run()
97 task_handler->state = OSI_RUN; in OSI_task_run()
101 task_handler->name); in OSI_task_run()
110 OSI_STATE OSI_task_isRun(tOSI_TASK_HANDLER task_handler) { in OSI_task_isRun() argument
113 if (task_handler && task_handler->state == OSI_RUN) ret = OSI_RUN; in OSI_task_isRun()
118 OSI_STATE OSI_task_stop(tOSI_TASK_HANDLER task_handler) { in OSI_task_stop() argument
120 if (!task_handler) return OSI_OK; in OSI_task_stop()
123 if (task_handler->state == OSI_RUN) { in OSI_task_stop()
126 ret = (OSI_STATE)pthread_join(task_handler->task, NULL); in OSI_task_stop()
130 task_handler->state = OSI_ALLOCATED; in OSI_task_stop()
136 OSI_STATE OSI_task_free(tOSI_TASK_HANDLER task_handler) { in OSI_task_free() argument
139 OSI_task_stop(task_handler); in OSI_task_free()
141 task_handler->name = NULL; in OSI_task_free()
142 task_handler->state = OSI_FREE; in OSI_task_free()
148 OSI_STATE OSI_task_kill(tOSI_TASK_HANDLER task_handler) { in OSI_task_kill() argument
150 if (!task_handler) return OSI_OK; in OSI_task_kill()
153 if (task_handler->state == OSI_RUN) { in OSI_task_kill()
156 ret = (OSI_STATE)pthread_join(task_handler->task, NULL); in OSI_task_kill()
160 task_handler->name = NULL; in OSI_task_kill()
161 task_handler->state = OSI_FREE; in OSI_task_kill()