Ignore:
Timestamp:
2024-01-21T15:48:43Z (4 months ago)
Author:
Jiří Zárevúcky <zarevucky.jiri@…>
Branches:
master
Children:
515f1b1
Parents:
33e15a0
git-author:
Jiří Zárevúcky <zarevucky.jiri@…> (2023-03-29 10:25:36)
git-committer:
Jiří Zárevúcky <zarevucky.jiri@…> (2024-01-21 15:48:43)
Message:

Make thread cycle statistics atomic

File:
1 edited

Legend:

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

    r33e15a0 r11909ce3  
    114114
    115115        /* Account user cycles */
    116         if (THREAD) {
    117                 irq_spinlock_lock(&THREAD->lock, false);
     116        if (THREAD)
    118117                thread_update_accounting(true);
    119                 irq_spinlock_unlock(&THREAD->lock, false);
    120         }
    121118
    122119        /* Account CPU usage if it woke up from sleep */
     
    155152
    156153        /* Do not charge THREAD for exception cycles */
    157         if (THREAD) {
    158                 irq_spinlock_lock(&THREAD->lock, false);
     154        if (THREAD)
    159155                THREAD->last_cycle = end_cycle;
    160                 irq_spinlock_unlock(&THREAD->lock, false);
    161         }
    162156#else
    163157        panic("No space for any exception handler, yet we want to handle some exception.");
Note: See TracChangeset for help on using the changeset viewer.