Skip to content

Commit e783968

Browse files
committed
Merge remote-tracking branch 'brson/mainthread'
Conflicts: src/rt/rust_sched_loop.cpp src/rt/rust_shape.cpp src/rt/rust_task.cpp
2 parents 2106463 + de47fcf commit e783968

30 files changed

+577
-260
lines changed

mk/rt.mk

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,11 @@ RUNTIME_CS_$(1) := \
5050
rt/rust_builtin.cpp \
5151
rt/rust_run_program.cpp \
5252
rt/rust_env.cpp \
53-
rt/rust_task_thread.cpp \
53+
rt/rust_sched_loop.cpp \
54+
rt/rust_sched_launcher.cpp \
55+
rt/rust_sched_driver.cpp \
5456
rt/rust_scheduler.cpp \
57+
rt/rust_sched_reaper.cpp \
5558
rt/rust_task.cpp \
5659
rt/rust_stack.cpp \
5760
rt/rust_port.cpp \

src/etc/x86.supp

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -389,6 +389,34 @@
389389
fun:uv_loop_delete
390390
}
391391

392+
{
393+
lock_and_signal-probably-threadsafe-access-outside-of-lock
394+
Helgrind:Race
395+
fun:_ZN15lock_and_signal27lock_held_by_current_threadEv
396+
...
397+
}
398+
399+
{
400+
lock_and_signal-probably-threadsafe-access-outside-of-lock2
401+
Helgrind:Race
402+
fun:_ZN15lock_and_signal6unlockEv
403+
...
404+
}
405+
406+
{
407+
lock_and_signal-probably-threadsafe-access-outside-of-lock3
408+
Helgrind:Race
409+
fun:_ZN15lock_and_signal4lockEv
410+
...
411+
}
412+
413+
{
414+
lock_and_signal-probably-threadsafe-access-outside-of-lock4
415+
Helgrind:Race
416+
fun:_ZN15lock_and_signal4waitEv
417+
...
418+
}
419+
392420
{
393421
uv-async-send-does-racy-things
394422
Helgrind:Race

src/rt/rust.cpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -80,21 +80,20 @@ rust_start(uintptr_t main_fn, int argc, char **argv, void* crate_map) {
8080
rust_sched_id sched_id = kernel->create_scheduler(env->num_sched_threads);
8181
rust_scheduler *sched = kernel->get_scheduler_by_id(sched_id);
8282
rust_task *root_task = sched->create_task(NULL, "main");
83-
rust_task_thread *thread = root_task->thread;
8483
command_line_args *args
8584
= new (kernel, "main command line args")
8685
command_line_args(root_task, argc, argv);
8786

88-
DLOG(thread, dom, "startup: %d args in 0x%" PRIxPTR,
87+
LOG(root_task, dom, "startup: %d args in 0x%" PRIxPTR,
8988
args->argc, (uintptr_t)args->args);
9089
for (int i = 0; i < args->argc; i++) {
91-
DLOG(thread, dom, "startup: arg[%d] = '%s'", i, args->argv[i]);
90+
LOG(root_task, dom, "startup: arg[%d] = '%s'", i, args->argv[i]);
9291
}
9392

9493
root_task->start((spawn_fn)main_fn, NULL, args->args);
9594
root_task = NULL;
9695

97-
int ret = kernel->wait_for_schedulers();
96+
int ret = kernel->wait_for_exit();
9897
delete args;
9998
delete kernel;
10099
delete srv;

0 commit comments

Comments
 (0)