Add a way to run the test suite with the new scheduler

TESTARGS=--newrt make check-stage1-rpass

Conflicts:
	src/rt/rustrt.def.in
This commit is contained in:
Brian Anderson
2013-03-15 18:06:19 -07:00
parent a882554a78
commit 044703435b
8 changed files with 95 additions and 22 deletions

View File

@@ -882,6 +882,37 @@ rust_get_rt_env() {
return task->kernel->env;
}
typedef void *(*nullary_fn)();
extern "C" CDECL void
rust_call_nullary_fn(nullary_fn f) {
f();
}
#ifndef _WIN32
pthread_key_t sched_key;
#else
DWORD sched_key;
#endif
extern "C" void*
rust_get_sched_tls_key() {
return &sched_key;
}
extern "C" CDECL void
rust_initialize_global_state() {
#ifndef _WIN32
assert(!pthread_key_create(&sched_key, NULL));
#else
sched_key = TlsAlloc();
assert(sched_key != TLS_OUT_OF_INDEXES);
#endif
}
//
// Local Variables:
// mode: C++