Changeset 9cefba4 in mainline for include/proc/thread.h


Ignore:
Timestamp:
2005-10-16T19:18:19Z (20 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
ba1b2194
Parents:
0bed5d0
Message:

Doxygen-style comments.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • include/proc/thread.h

    r0bed5d0 r9cefba4  
    4646
    4747enum state {
    48         Invalid,
    49         Running,
    50         Sleeping,
    51         Ready,
    52         Entering,
    53         Exiting
     48        Invalid,        /**< It is an error, if thread is found in this state. */
     49        Running,        /**< State of a thread that is currently executing on some CPU. */
     50        Sleeping,       /**< Thread in this state is waiting for an event. */
     51        Ready,          /**< State of threads in a run queue. */
     52        Entering,       /**< Threads are in this state before they are first readied. */
     53        Exiting         /**< After a thread calls thread_exit(), it is put into Exiting state. */
    5454};
    5555
     
    6060
    6161struct thread {
    62         link_t rq_link;                         /* run queue link */
    63         link_t wq_link;                         /* wait queue link */
    64         link_t th_link;                         /* links to threads within the parent task*/
    65         link_t threads_link;
     62        link_t rq_link;                         /**< Run queue link. */
     63        link_t wq_link;                         /**< Wait queue link. */
     64        link_t th_link;                         /**< Links to threads within containing task. */
     65        link_t threads_link;                    /**< Link to the list of all threads. */
    6666       
    6767        /* items below are protected by lock */
    6868        spinlock_t lock;
    6969
    70         void (* thread_code)(void *);
    71         void *thread_arg;
     70        void (* thread_code)(void *);           /**< Function implementing the thread. */
     71        void *thread_arg;                       /**< Argument passed to thread_code() function. */
    7272
    73         context_t saved_context;
    74         context_t sleep_timeout_context;
     73        context_t saved_context;                /**< From here, the stored context is restored when the thread is scheduled. */
     74        context_t sleep_timeout_context;        /**< From here, the stored failover context is restored when sleep times out. */
     75
     76        waitq_t *sleep_queue;                   /**< Wait queue in which this thread sleeps. */
     77        timeout_t sleep_timeout;                /**< Timeout used for timeoutable sleeping.  */
     78        volatile int timeout_pending;           /**< Flag signalling sleep timeout in progress. */
     79
    7580        fpu_context_t saved_fpu_context;
    7681        int fpu_context_exists;
     
    8388        int fpu_context_engaged;
    8489
    85         waitq_t *sleep_queue;
    86         timeout_t sleep_timeout;
    87         volatile int timeout_pending;
     90        rwlock_type_t rwlock_holder_type;
    8891
    89         rwlock_type_t rwlock_holder_type;
    90         void (* call_me)(void *);
    91         void *call_me_with;
     92        void (* call_me)(void *);               /**< Funtion to be called in scheduler before the thread is put asleep. */
     93        void *call_me_with;                     /**< Argument passed to call_me(). */
    9294
    93         int state;
    94         int flags;
     95        state_t state;                          /**< Thread's state. */
     96        int flags;                              /**< Thread's flags. */
    9597       
    96         cpu_t *cpu;
    97         task_t *task;
     98        cpu_t *cpu;                             /**< Thread's CPU. */
     99        task_t *task;                           /**< Containing task. */
    98100
    99         __u64 ticks;
     101        __u64 ticks;                            /**< Ticks before preemption. */
    100102
    101         __u32 tid;
     103        int pri;                                /**< Thread's priority. Implemented as index of run queue. */
     104        __u32 tid;                              /**< Thread ID. */
    102105       
    103         int pri;
    104        
    105         ARCH_THREAD_DATA;
     106        ARCH_THREAD_DATA;                       /**< Architecture-specific data. */
    106107
    107         __u8 *kstack;
    108         __u8 *ustack;
     108        __u8 *kstack;                           /**< Thread's kernel stack. */
     109        __u8 *ustack;                           /**< Thread's user stack. */
    109110};
    110111
    111 extern spinlock_t threads_lock;
    112 extern link_t threads_head;
     112extern spinlock_t threads_lock;                 /**< Lock protecting threads_head list. */
     113extern link_t threads_head;                     /**< List of all threads in the system. */
    113114
    114115static void cushion(void);
Note: See TracChangeset for help on using the changeset viewer.