Skip to content

Commit 642db38

Browse files
committed
---
yaml --- r: 4291 b: refs/heads/master c: 6657e72 h: refs/heads/master i: 4289: 01b7fb7 4287: ba9c0da v: v3
1 parent 605f717 commit 642db38

File tree

3 files changed

+4
-3
lines changed

3 files changed

+4
-3
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
---
2-
refs/heads/master: 96a629d2fa5144ccba39cc0e4258b6e0fe2da283
2+
refs/heads/master: 6657e729de2d4544d4f014091ef05878937895dc

trunk/src/rt/rust_kernel.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,9 @@ int rust_kernel::start_task_threads()
135135

136136
rust_task *
137137
rust_kernel::create_task(rust_task *spawner, const char *name) {
138-
return threads[rand(&rctx) % num_threads]->create_task(spawner, name);
138+
rust_scheduler *thread = threads[rand(&rctx) % num_threads];
139+
scoped_lock with(thread->lock);
140+
return thread->create_task(spawner, name);
139141
}
140142

141143
void rust_kernel::wakeup_schedulers() {

trunk/src/rt/rust_upcall.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -526,7 +526,6 @@ extern "C" CDECL rust_task *
526526
upcall_new_task(rust_task *spawner, rust_vec *name) {
527527
// name is a rust string structure.
528528
LOG_UPCALL_ENTRY(spawner);
529-
scoped_lock with(spawner->sched->lock);
530529
rust_task *task =
531530
spawner->kernel->create_task(spawner, (const char *)name->data);
532531
task->ref();

0 commit comments

Comments
 (0)