Changeset 9cefba4 in mainline for include/proc/thread.h
- Timestamp:
- 2005-10-16T19:18:19Z (20 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- ba1b2194
- Parents:
- 0bed5d0
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
include/proc/thread.h
r0bed5d0 r9cefba4 46 46 47 47 enum 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. */ 54 54 }; 55 55 … … 60 60 61 61 struct 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. */ 66 66 67 67 /* items below are protected by lock */ 68 68 spinlock_t lock; 69 69 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. */ 72 72 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 75 80 fpu_context_t saved_fpu_context; 76 81 int fpu_context_exists; … … 83 88 int fpu_context_engaged; 84 89 85 waitq_t *sleep_queue; 86 timeout_t sleep_timeout; 87 volatile int timeout_pending; 90 rwlock_type_t rwlock_holder_type; 88 91 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(). */ 92 94 93 int state;94 int flags; 95 state_t state; /**< Thread's state. */ 96 int flags; /**< Thread's flags. */ 95 97 96 cpu_t *cpu; 97 task_t *task; 98 cpu_t *cpu; /**< Thread's CPU. */ 99 task_t *task; /**< Containing task. */ 98 100 99 __u64 ticks; 101 __u64 ticks; /**< Ticks before preemption. */ 100 102 101 __u32 tid; 103 int pri; /**< Thread's priority. Implemented as index of run queue. */ 104 __u32 tid; /**< Thread ID. */ 102 105 103 int pri; 104 105 ARCH_THREAD_DATA; 106 ARCH_THREAD_DATA; /**< Architecture-specific data. */ 106 107 107 __u8 *kstack; 108 __u8 *ustack; 108 __u8 *kstack; /**< Thread's kernel stack. */ 109 __u8 *ustack; /**< Thread's user stack. */ 109 110 }; 110 111 111 extern spinlock_t threads_lock; 112 extern link_t threads_head; 112 extern spinlock_t threads_lock; /**< Lock protecting threads_head list. */ 113 extern link_t threads_head; /**< List of all threads in the system. */ 113 114 114 115 static void cushion(void);
Note:
See TracChangeset
for help on using the changeset viewer.