Fork us on GitHub Follow us on Facebook Follow us on Twitter

Changeset fe7bcf1 in mainline


Ignore:
Timestamp:
2019-12-11T15:26:16Z (12 months ago)
Author:
Martin Decky <martin@…>
Branches:
master
Children:
086cab0
Parents:
a6302ae
Message:

fix race condition in traversing tasks

The task reference count can be lowered only after we have moved to the
next task.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • kernel/generic/src/sysinfo/stats.c

    ra6302ae rfe7bcf1  
    485485
    486486                irq_spinlock_lock(&tasks_lock, true);
    487                 task_release(task);
    488 
    489                 task = task_next(task);
     487
     488                task_t *prev_task = task;
     489                task = task_next(prev_task);
     490                task_release(prev_task);
    490491        }
    491492
Note: See TracChangeset for help on using the changeset viewer.