示例#1
0
文件: test.c 项目: jinlee/masters
/* returns true if the state changed. */
bool test_update_state(conf_object_t *cpu, struct test_state *t,
		       struct sched_state *s)
{
	if (anybody_alive(cpu, t, s)) {
		if (!t->test_is_running) {
			lsprintf(BRANCH, "a test appears to be starting - ");
			print_qs(BRANCH, s);
			printf(BRANCH, "\n");
			t->test_is_running = true;
			return true;
		}
	} else {
		if (t->test_is_running) {
			lsprintf(BRANCH, "a test appears to be ending - ");
			print_qs(BRANCH, s);
			printf(BRANCH, "\n");
			if (t->current_test) {
				MM_FREE(t->current_test);
				t->current_test = NULL;
			}
			t->test_is_running = false;
			return true;
		}
	}
	return false;
}
示例#2
0
文件: arbiter.c 项目: bblum/landslide
static bool report_deadlock(struct ls_state *ls)
{
	if (BUG_ON_THREADS_WEDGED == 0) {
		return false;
	}

	if (!anybody_alive(ls->cpu0, &ls->test, &ls->sched, true)) {
		/* No threads exist. Not a deadlock, but rather end of test. */
		return false;
	}

	struct agent *a;
	FOR_EACH_RUNNABLE_AGENT(a, &ls->sched,
		if (BLOCKED(a) && a->action.disk_io) {
			lsprintf(CHOICE, COLOUR_BOLD COLOUR_YELLOW "Warning, "
				 "'ad-hoc' yield blocking (mutexes?) is not "
				 "suitable for disk I/O! (TID %d)\n", a->tid);
			return false;
		}