Ignore:
Timestamp:
2007-07-29T13:50:20Z (17 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
83a5cba
Parents:
d1e9321
Message:

Replace the threads_btree B+tree with an AVL tree. The new variable is called
threads_tree. For printing list of threads, use the new AVL tree walker
mechanism.

This solves half of ticket #48.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • kernel/generic/include/proc/thread.h

    rd1e9321 r5dcee525  
    4242#include <synch/rwlock.h>
    4343#include <synch/spinlock.h>
    44 #include <adt/btree.h>
     44#include <adt/avl.h>
    4545#include <mm/slab.h>
    4646#include <arch/cpu.h>
     
    9191        link_t wq_link;         /**< Wait queue link. */
    9292        link_t th_link;         /**< Links to threads within containing task. */
     93
     94        /** Threads linkage to the threads_tree. */
     95        avltree_node_t threads_tree_node;
    9396       
    9497        /** Lock protecting thread structure.
     
    205208/** Thread list lock.
    206209 *
    207  * This lock protects all link_t structures chained in threads_head.
     210 * This lock protects the threads_tree.
    208211 * Must be acquired before T.lock for each T of type thread_t.
    209212 *
     
    211214SPINLOCK_EXTERN(threads_lock);
    212215
    213 /** B+tree containing all threads. */
    214 extern btree_t threads_btree;
     216/** AVL tree containing all threads. */
     217extern avltree_t threads_tree;
    215218
    216219extern void thread_init(void);
Note: See TracChangeset for help on using the changeset viewer.