@@ -440,6 +440,7 @@ rust_task::transition(rust_task_list *src, rust_task_list *dst) {
440
440
441
441
void
442
442
rust_task::block (rust_cond *on, const char * name) {
443
+ I (sched, !lock.lock_held_by_current_thread ());
443
444
scoped_lock with (lock);
444
445
LOG (this , task, " Blocking on 0x%" PRIxPTR " , cond: 0x%" PRIxPTR,
445
446
(uintptr_t ) on, (uintptr_t ) cond);
@@ -453,6 +454,7 @@ rust_task::block(rust_cond *on, const char* name) {
453
454
454
455
void
455
456
rust_task::wakeup (rust_cond *from) {
457
+ I (sched, !lock.lock_held_by_current_thread ());
456
458
scoped_lock with (lock);
457
459
A (sched, cond != NULL , " Cannot wake up unblocked task." );
458
460
LOG (this , task, " Blocked on 0x%" PRIxPTR " woken up on 0x%" PRIxPTR,
@@ -473,6 +475,7 @@ rust_task::wakeup(rust_cond *from) {
473
475
474
476
void
475
477
rust_task::die () {
478
+ I (sched, !lock.lock_held_by_current_thread ());
476
479
scoped_lock with (lock);
477
480
transition (&sched->running_tasks , &sched->dead_tasks );
478
481
sched->lock .signal ();
@@ -535,6 +538,7 @@ void rust_task::on_wakeup(rust_task::wakeup_callback *callback) {
535
538
}
536
539
537
540
rust_port_id rust_task::register_port (rust_port *port) {
541
+ I (sched, !lock.lock_held_by_current_thread ());
538
542
scoped_lock with (lock);
539
543
540
544
rust_port_id id = next_port_id++;
@@ -543,11 +547,13 @@ rust_port_id rust_task::register_port(rust_port *port) {
543
547
}
544
548
545
549
void rust_task::release_port (rust_port_id id) {
550
+ I (sched, !lock.lock_held_by_current_thread ());
546
551
scoped_lock with (lock);
547
552
port_table.remove (id);
548
553
}
549
554
550
555
rust_port *rust_task::get_port_by_id (rust_port_id id) {
556
+ I (sched, !lock.lock_held_by_current_thread ());
551
557
scoped_lock with (lock);
552
558
rust_port *port = NULL ;
553
559
port_table.get (id, &port);
@@ -571,6 +577,7 @@ rust_port *rust_task::get_port_by_chan_handle(chan_handle *handle) {
571
577
// to another.
572
578
const type_desc *
573
579
rust_task::release_alloc (void *alloc) {
580
+ I (sched, !lock.lock_held_by_current_thread ());
574
581
lock.lock ();
575
582
576
583
assert (local_allocs.find (alloc) != local_allocs.end ());
@@ -587,6 +594,7 @@ rust_task::release_alloc(void *alloc) {
587
594
// reparented to this one.
588
595
void
589
596
rust_task::claim_alloc (void *alloc, const type_desc *tydesc) {
597
+ I (sched, !lock.lock_held_by_current_thread ());
590
598
lock.lock ();
591
599
592
600
assert (local_allocs.find (alloc) == local_allocs.end ());
0 commit comments