Changeset 1d432f9 in mainline for kernel/generic/src/proc


Ignore:
Timestamp:
2010-05-31T22:33:44Z (15 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
179d052
Parents:
3a2b636
Message:

Reflect assumptions about lock and interrupt state in functions themselves.

Location:
kernel/generic/src/proc
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • kernel/generic/src/proc/task.c

    r3a2b636 r1d432f9  
    351351task_t *task_find_by_id(task_id_t id)
    352352{
     353        ASSERT(interrupts_disabled());
     354        ASSERT(irq_spinlock_locked(&tasks_lock));
     355
    353356        avltree_node_t *node =
    354357            avltree_search(&tasks_tree, (avltree_key_t) id);
     
    362365/** Get accounting data of given task.
    363366 *
    364  * Note that task lock of 't' must be already held and interrupts must be
     367 * Note that task lock of 'task' must be already held and interrupts must be
    365368 * already disabled.
    366369 *
     
    372375void task_get_accounting(task_t *task, uint64_t *ucycles, uint64_t *kcycles)
    373376{
     377        ASSERT(interrupts_disabled());
     378        ASSERT(irq_spinlock_locked(&task->lock));
     379
    374380        /* Accumulated values of task */
    375381        uint64_t uret = task->ucycles;
  • kernel/generic/src/proc/thread.c

    r3a2b636 r1d432f9  
    683683bool thread_exists(thread_t *thread)
    684684{
     685        ASSERT(interrupts_disabled());
     686        ASSERT(irq_spinlock_locked(&threads_lock));
     687
    685688        avltree_node_t *node =
    686689            avltree_search(&threads_tree, (avltree_key_t) ((uintptr_t) thread));
     
    700703{
    701704        uint64_t time = get_cycle();
     705
     706        ASSERT(interrupts_disabled());
     707        ASSERT(irq_spinlock_locked(&THREAD->lock));
    702708       
    703709        if (user)
     
    735741thread_t *thread_find_by_id(thread_id_t thread_id)
    736742{
     743        ASSERT(interrupts_disabled());
     744        ASSERT(irq_spinlock_locked(&threads_lock));
     745
    737746        thread_iterator_t iterator;
    738747       
Note: See TracChangeset for help on using the changeset viewer.