Changeset cd98e594 in mainline


Ignore:
Timestamp:
2010-05-09T18:26:39Z (14 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
e2fcdb1
Parents:
5e984f2
Message:

Lock THREAD before calling thread_update_accounting() from exc_dispatch().

File:
1 edited

Legend:

Unmodified
Added
Removed
  • kernel/generic/src/interrupt/interrupt.c

    r5e984f2 rcd98e594  
    9393
    9494        /* Account user cycles */
    95         if (THREAD)
     95        if (THREAD) {
     96                spinlock_lock(&THREAD->lock);
    9697                thread_update_accounting(true);
     98                spinlock_unlock(&THREAD->lock);
     99        }
    97100
    98101#ifdef CONFIG_UDEBUG
     
    110113                thread_exit();
    111114
    112         if (THREAD)
     115        if (THREAD) {
     116                spinlock_lock(&THREAD->lock);
    113117                thread_update_accounting(false);
     118                spinlock_unlock(&THREAD->lock);
     119        }
    114120}
    115121
Note: See TracChangeset for help on using the changeset viewer.