Skip to content

Commit 20efa9a

Browse files
committed
---
yaml --- r: 6252 b: refs/heads/master c: 2385dea h: refs/heads/master v: v3
1 parent cdeac4d commit 20efa9a

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

[refs]

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
---
2-
refs/heads/master: 5e0e32faac1af7b239f5d1f11d6afa620c96a781
2+
refs/heads/master: 2385deaa0dcf2f3935e1c6a7d016ed25704ce063

trunk/src/rt/rust_task.cpp

+8
Original file line numberDiff line numberDiff line change
@@ -440,6 +440,7 @@ rust_task::transition(rust_task_list *src, rust_task_list *dst) {
440440

441441
void
442442
rust_task::block(rust_cond *on, const char* name) {
443+
I(sched, !lock.lock_held_by_current_thread());
443444
scoped_lock with(lock);
444445
LOG(this, task, "Blocking on 0x%" PRIxPTR ", cond: 0x%" PRIxPTR,
445446
(uintptr_t) on, (uintptr_t) cond);
@@ -453,6 +454,7 @@ rust_task::block(rust_cond *on, const char* name) {
453454

454455
void
455456
rust_task::wakeup(rust_cond *from) {
457+
I(sched, !lock.lock_held_by_current_thread());
456458
scoped_lock with(lock);
457459
A(sched, cond != NULL, "Cannot wake up unblocked task.");
458460
LOG(this, task, "Blocked on 0x%" PRIxPTR " woken up on 0x%" PRIxPTR,
@@ -473,6 +475,7 @@ rust_task::wakeup(rust_cond *from) {
473475

474476
void
475477
rust_task::die() {
478+
I(sched, !lock.lock_held_by_current_thread());
476479
scoped_lock with(lock);
477480
transition(&sched->running_tasks, &sched->dead_tasks);
478481
sched->lock.signal();
@@ -535,6 +538,7 @@ void rust_task::on_wakeup(rust_task::wakeup_callback *callback) {
535538
}
536539

537540
rust_port_id rust_task::register_port(rust_port *port) {
541+
I(sched, !lock.lock_held_by_current_thread());
538542
scoped_lock with(lock);
539543

540544
rust_port_id id = next_port_id++;
@@ -543,11 +547,13 @@ rust_port_id rust_task::register_port(rust_port *port) {
543547
}
544548

545549
void rust_task::release_port(rust_port_id id) {
550+
I(sched, !lock.lock_held_by_current_thread());
546551
scoped_lock with(lock);
547552
port_table.remove(id);
548553
}
549554

550555
rust_port *rust_task::get_port_by_id(rust_port_id id) {
556+
I(sched, !lock.lock_held_by_current_thread());
551557
scoped_lock with(lock);
552558
rust_port *port = NULL;
553559
port_table.get(id, &port);
@@ -571,6 +577,7 @@ rust_port *rust_task::get_port_by_chan_handle(chan_handle *handle) {
571577
// to another.
572578
const type_desc *
573579
rust_task::release_alloc(void *alloc) {
580+
I(sched, !lock.lock_held_by_current_thread());
574581
lock.lock();
575582

576583
assert(local_allocs.find(alloc) != local_allocs.end());
@@ -587,6 +594,7 @@ rust_task::release_alloc(void *alloc) {
587594
// reparented to this one.
588595
void
589596
rust_task::claim_alloc(void *alloc, const type_desc *tydesc) {
597+
I(sched, !lock.lock_held_by_current_thread());
590598
lock.lock();
591599

592600
assert(local_allocs.find(alloc) == local_allocs.end());

0 commit comments

Comments
 (0)