Changeset aab5e46 in mainline for kernel/generic/src/sysinfo/stats.c


Ignore:
Timestamp:
2018-11-03T23:32:39Z (5 years ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
790f3a3
Parents:
ef1eab7
Message:

Thread and task iterator functions.

File:
1 edited

Legend:

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

    ref1eab7 raab5e46  
    246246
    247247        /* Count the tasks */
    248         size_t count = odict_count(&tasks);
     248        size_t count = task_count();
    249249
    250250        if (count == 0) {
     
    271271        /* Gather the statistics for each task */
    272272        size_t i = 0;
    273         odlink_t *odlink = odict_first(&tasks);
    274         while (odlink != NULL) {
    275                 task_t *task = odict_get_instance(odlink, task_t, ltasks);
    276 
     273        task_t *task = task_first();
     274        while (task != NULL) {
    277275                /* Interrupts are already disabled */
    278276                irq_spinlock_lock(&(task->lock), false);
     
    283281
    284282                irq_spinlock_unlock(&(task->lock), false);
    285                 odlink = odict_next(odlink, &tasks);
     283                task = task_next(task);
    286284        }
    287285
     
    336334
    337335        /* Count the threads */
    338         size_t count = odict_count(&threads);
     336        size_t count = thread_count();
    339337
    340338        if (count == 0) {
     
    362360        size_t i = 0;
    363361
    364         odlink_t *odlink = odict_first(&threads);
    365         while (odlink != NULL) {
    366                 thread_t *thread = odict_get_instance(odlink, thread_t,
    367                     lthreads);
    368 
     362        thread_t *thread = thread_first();
     363        while (thread != NULL) {
    369364                /* Interrupts are already disabled */
    370365                irq_spinlock_lock(&thread->lock, false);
     
    376371                irq_spinlock_unlock(&thread->lock, false);
    377372
    378                 odlink = odict_next(odlink, &threads);
     373                thread = thread_next(thread);
    379374        }
    380375
Note: See TracChangeset for help on using the changeset viewer.