rt: Checking port_table.is_empty() requires a lock

This commit is contained in:
Brian Anderson 2012-03-02 17:10:14 -08:00
parent 04d9cc18a5
commit ed7d25bb6d
1 changed files with 6 additions and 1 deletions

View File

@ -108,7 +108,12 @@ void
rust_task::delete_this()
{
I(thread, !thread->lock.lock_held_by_current_thread());
I(thread, port_table.is_empty());
{
scoped_lock with (lock);
I(thread, port_table.is_empty());
}
DLOG(thread, task, "~rust_task %s @0x%" PRIxPTR ", refcnt=%d",
name, (uintptr_t)this, ref_count);