Changeset 2569ec90 in mainline for generic/src/ddi/ddi.c


Ignore:
Timestamp:
2006-06-05T18:15:30Z (18 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
b65caba1
Parents:
31e8ddd
Message:

In task_kill(), remove the task from the tasks_btree before proceeding.
Thus, when the kernel finds the task in the tasks_btree and locks it before
releasing tasks_lock, it is guaranteed that the task will not be destroyed
until the lock is held. If the kernel needs to unlock the task, do some operation
and lock it again, it should increase its refcount before doing so. In that case,
when releasing the lock, it must decrement the refcount and if it reaches
zero, it must call task_destroy().

File:
1 edited

Legend:

Unmodified
Added
Removed
  • generic/src/ddi/ddi.c

    r31e8ddd r2569ec90  
    136136        }
    137137
    138         /*
    139          * TODO: We are currently lacking support for task destroying.
    140          * Once it is added to the kernel, we must take care to
    141          * synchronize in a way that prevents race conditions here.
    142          */
    143        
    144138        /* Lock the task and release the lock protecting tasks_btree. */
    145139        spinlock_lock(&t->lock);
Note: See TracChangeset for help on using the changeset viewer.