Skip to content

Commit 0432030

Browse files
committed
rt: Don't take the task lock on state transitions
1 parent 43f9f4d commit 0432030

File tree

1 file changed

+0
-6
lines changed

1 file changed

+0
-6
lines changed

src/rt/rust_task.cpp

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -421,8 +421,6 @@ rust_task::transition(rust_task_list *src, rust_task_list *dst) {
421421

422422
void
423423
rust_task::block(rust_cond *on, const char* name) {
424-
I(thread, !lock.lock_held_by_current_thread());
425-
scoped_lock with(lock);
426424
LOG(this, task, "Blocking on 0x%" PRIxPTR ", cond: 0x%" PRIxPTR,
427425
(uintptr_t) on, (uintptr_t) cond);
428426
A(thread, cond == NULL, "Cannot block an already blocked task.");
@@ -435,8 +433,6 @@ rust_task::block(rust_cond *on, const char* name) {
435433

436434
void
437435
rust_task::wakeup(rust_cond *from) {
438-
I(thread, !lock.lock_held_by_current_thread());
439-
scoped_lock with(lock);
440436
A(thread, cond != NULL, "Cannot wake up unblocked task.");
441437
LOG(this, task, "Blocked on 0x%" PRIxPTR " woken up on 0x%" PRIxPTR,
442438
(uintptr_t) cond, (uintptr_t) from);
@@ -449,8 +445,6 @@ rust_task::wakeup(rust_cond *from) {
449445

450446
void
451447
rust_task::die() {
452-
I(thread, !lock.lock_held_by_current_thread());
453-
scoped_lock with(lock);
454448
transition(&thread->running_tasks, &thread->dead_tasks);
455449
}
456450

0 commit comments

Comments
 (0)