Example #1
0
static inline char *task_decode_status(struct wind_task *task, char *buf)
{
	int status;

	*buf = '\0';
	status = threadobj_get_status(&task->thobj);
	if (status & THREADOBJ_SCHEDLOCK)
		strcat(buf, "+sched_lock");
	if (status & THREADOBJ_ROUNDROBIN)
		strcat(buf, "+sched_rr");

	status = task->tcb->status;
	if (status == WIND_READY)
		strcat(buf, "+ready");
	else {
		if (status & WIND_SUSPEND)
			strcat(buf, "+suspended");
		if (status & WIND_PEND)
			strcat(buf, "+pending");
		if (status & WIND_DELAY)
			strcat(buf, "+delayed");
	}

	return buf + 1;
}
Example #2
0
BOOL taskIsSuspended(TASK_ID task_id)
{
	struct wind_task *task;
	int status;

	task = get_wind_task(task_id);
	if (task == NULL)
		return 0;

	status = threadobj_get_status(&task->thobj);

	put_wind_task(task);

	return (status & __THREAD_S_SUSPENDED) != 0;
}