Subversion Repositories HelenOS-historic

Rev

Rev 534 | Rev 777 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 534 Rev 557
Line 62... Line 62...
62
    link_t rq_link;             /**< Run queue link. */
62
    link_t rq_link;             /**< Run queue link. */
63
    link_t wq_link;             /**< Wait queue link. */
63
    link_t wq_link;             /**< Wait queue link. */
64
    link_t th_link;             /**< Links to threads within containing task. */
64
    link_t th_link;             /**< Links to threads within containing task. */
65
    link_t threads_link;            /**< Link to the list of all threads. */
65
    link_t threads_link;            /**< Link to the list of all threads. */
66
   
66
   
-
 
67
    /** Lock protecting thread structure.
-
 
68
     *
67
    /* items below are protected by lock */
69
     * Protects the whole thread structure except list links above.
-
 
70
     * Must be acquired before T.lock for each T of type task_t.
-
 
71
     *
-
 
72
     */
68
    spinlock_t lock;
73
    spinlock_t lock;
69
 
74
 
70
    void (* thread_code)(void *);       /**< Function implementing the thread. */
75
    void (* thread_code)(void *);       /**< Function implementing the thread. */
71
    void *thread_arg;           /**< Argument passed to thread_code() function. */
76
    void *thread_arg;           /**< Argument passed to thread_code() function. */
72
 
77
 
Line 107... Line 112...
107
 
112
 
108
    __u8 *kstack;               /**< Thread's kernel stack. */
113
    __u8 *kstack;               /**< Thread's kernel stack. */
109
    __u8 *ustack;               /**< Thread's user stack. */
114
    __u8 *ustack;               /**< Thread's user stack. */
110
};
115
};
111
 
116
 
-
 
117
/** Thread list lock.
-
 
118
 *
112
extern spinlock_t threads_lock;         /**< Lock protecting threads_head list. */
119
 * This lock protects all link_t structures chained in threads_head.
-
 
120
 * Must be acquired before T.lock for each T of type thread_t.
-
 
121
 *
-
 
122
 */
-
 
123
extern spinlock_t threads_lock;
-
 
124
 
113
extern link_t threads_head;         /**< List of all threads in the system. */
125
extern link_t threads_head;         /**< List of all threads in the system. */
114
 
126
 
115
extern void thread_init(void);
127
extern void thread_init(void);
116
extern thread_t *thread_create(void (* func)(void *), void *arg, task_t *task, int flags);
128
extern thread_t *thread_create(void (* func)(void *), void *arg, task_t *task, int flags);
117
extern void thread_ready(thread_t *t);
129
extern void thread_ready(thread_t *t);