|
ChibiOS 21.11.5
|
Structure representing a thread. More...
#include <chobjects.h>

Data Fields | |
| union { | |
| ch_list_t list | |
| Threads lists element. More... | |
| ch_queue_t queue | |
| Threads queues element. More... | |
| ch_priority_queue_t pqueue | |
| Threads ordered queues element. More... | |
| } | hdr |
| Shared list headers. | |
| struct port_context | ctx |
| Processor context. | |
| ch_queue_t | rqueue |
| Registry queue element. | |
| os_instance_t * | owner |
| OS instance owner of this thread. | |
| const char * | name |
Thread name or NULL. | |
| stkalign_t * | wabase |
| Working area base address. | |
| tstate_t | state |
| Current thread state. | |
| tmode_t | flags |
| Various thread flags. | |
| trefs_t | refs |
| References to this thread. | |
| tslices_t | ticks |
| Number of ticks remaining to this thread. | |
| volatile systime_t | time |
| Thread consumed time in ticks. | |
| union { | |
| msg_t rdymsg | |
| Thread wakeup code. More... | |
| msg_t exitcode | |
| Thread exit code. More... | |
| void * wtobjp | |
| Pointer to a generic "wait" object. More... | |
| thread_reference_t * wttrp | |
| Pointer to a generic thread reference object. More... | |
| struct ch_semaphore * wtsemp | |
| Pointer to a generic semaphore object. More... | |
| struct ch_mutex * wtmtxp | |
| Pointer to a generic mutex object. More... | |
| eventmask_t ewmask | |
| Enabled events mask. More... | |
| } | u |
| State-specific fields. | |
| ch_list_t | waiting |
| Termination waiting list. | |
| ch_queue_t | msgqueue |
| Messages queue. | |
| msg_t | sentmsg |
| Sent message. | |
| eventmask_t | epending |
| Pending events mask. | |
| struct ch_mutex * | mtxlist |
| List of the mutexes owned by this thread. | |
| tprio_t | realprio |
| Thread's own, non-inherited, priority. | |
| void * | mpool |
| Memory Pool where the thread workspace is returned. | |
| time_measurement_t | stats |
| Thread statistics. | |
Structure representing a thread.
Definition at line 153 of file chobjects.h.
| ch_list_t ch_thread::list |
| ch_queue_t ch_thread::queue |
Threads queues element.
Definition at line 165 of file chobjects.h.
Referenced by __sch_wakeup(), chCondWaitS(), chCondWaitTimeoutS(), and chMtxLockS().
| ch_priority_queue_t ch_thread::pqueue |
Threads ordered queues element.
Definition at line 169 of file chobjects.h.
Referenced by __sch_ready_ahead(), __sch_ready_behind(), __sch_reschedule_ahead(), __sch_reschedule_behind(), __thd_object_init(), chMtxLockS(), chMtxUnlock(), chMtxUnlockAllS(), chMtxUnlockS(), chSchDoPreemption(), chSchDoYieldS(), chSchGoSleepS(), chSchIsPreemptionRequired(), chSchPreemption(), chSchRescheduleS(), chSchSelectFirst(), chSchWakeupS(), chSysGetIdleThreadX(), chThdGetPriorityX(), and chThdSetPriority().
| union { ... } ch_thread::hdr |
Shared list headers.
Referenced by __sch_ready_ahead(), __sch_ready_behind(), __sch_reschedule_ahead(), __sch_reschedule_behind(), __sch_wakeup(), __thd_object_init(), chCondWaitS(), chCondWaitTimeoutS(), chMtxLockS(), chMtxUnlock(), chMtxUnlockAllS(), chMtxUnlockS(), chSchDoPreemption(), chSchDoYieldS(), chSchGoSleepS(), chSchIsPreemptionRequired(), chSchPreemption(), chSchRescheduleS(), chSchSelectFirst(), chSchWakeupS(), chSysGetIdleThreadX(), chThdGetPriorityX(), chThdSetPriority(), and chThdWait().
| struct port_context ch_thread::ctx |
Processor context.
Definition at line 174 of file chobjects.h.
| ch_queue_t ch_thread::rqueue |
Registry queue element.
Definition at line 179 of file chobjects.h.
Referenced by chRegNextThread().
| os_instance_t* ch_thread::owner |
OS instance owner of this thread.
Definition at line 184 of file chobjects.h.
Referenced by __sch_ready_ahead(), __sch_ready_behind(), __thd_object_init(), chSchGoSleepS(), chSchReadyI(), and chSchWakeupS().
| const char* ch_thread::name |
Thread name or NULL.
Definition at line 189 of file chobjects.h.
Referenced by __thd_object_init(), chRegGetThreadNameX(), and chRegSetThreadNameX().
| stkalign_t* ch_thread::wabase |
Working area base address.
Definition at line 198 of file chobjects.h.
Referenced by chInstanceObjectInit(), chThdCreateI(), chThdCreateStatic(), chThdCreateSuspendedI(), and chThdGetWorkingAreaX().
| tstate_t ch_thread::state |
Current thread state.
Definition at line 203 of file chobjects.h.
Referenced by __sch_ready_ahead(), __sch_ready_behind(), __sch_reschedule_ahead(), __sch_reschedule_behind(), __sch_wakeup(), __thd_object_init(), __trace_ready(), __trace_switch(), chEvtSignalI(), chInstanceObjectInit(), chMsgGet(), chMsgPollS(), chMsgRelease(), chMsgSend(), chMsgWaitS(), chMsgWaitTimeoutS(), chMtxLockS(), chSchDoPreemption(), chSchGoSleepS(), chSchGoSleepTimeoutS(), chSchReadyI(), chSchSelectFirst(), chSchWakeupS(), chThdDoDequeueNextI(), chThdExit(), chThdRelease(), chThdResumeI(), chThdResumeS(), chThdStart(), chThdStartI(), chThdTerminatedX(), chThdWait(), nil_find_thread(), and nil_ready_all().
| tmode_t ch_thread::flags |
Various thread flags.
Definition at line 207 of file chobjects.h.
Referenced by __thd_object_init(), chThdCreateFromHeap(), chThdCreateFromMemoryPool(), chThdExitS(), chThdRelease(), chThdShouldTerminateX(), and chThdTerminate().
| trefs_t ch_thread::refs |
References to this thread.
Definition at line 212 of file chobjects.h.
Referenced by __thd_object_init(), chRegFirstThread(), chRegNextThread(), chThdAddRef(), chThdExitS(), chThdRelease(), and chThdWait().
| tslices_t ch_thread::ticks |
Number of ticks remaining to this thread.
Definition at line 218 of file chobjects.h.
Referenced by __sch_reschedule_behind(), __thd_object_init(), chSchDoPreemption(), chSchGoSleepS(), chSchIsPreemptionRequired(), chSchPreemption(), and chSysTimerHandlerI().
| volatile systime_t ch_thread::time |
Thread consumed time in ticks.
Definition at line 225 of file chobjects.h.
Referenced by __thd_object_init(), chSysTimerHandlerI(), and chThdGetTicksX().
| msg_t ch_thread::rdymsg |
Thread wakeup code.
chSchWakeupS() function. Definition at line 239 of file chobjects.h.
Referenced by __sch_ready_ahead(), __sch_ready_behind(), __sch_wakeup(), chCondBroadcastI(), chCondSignalI(), chCondWaitS(), chEvtSignalI(), chMsgSend(), chSchGoSleepTimeoutS(), chSchWakeupS(), chSemAddCounterI(), chSemResetWithMessageI(), chSemSignalI(), chSemSignalWait(), chSemWaitS(), chThdDoDequeueNextI(), and chThdResumeI().
| msg_t ch_thread::exitcode |
Thread exit code.
chThdWait() on this thread. Definition at line 246 of file chobjects.h.
Referenced by chThdExitS(), and chThdWait().
| void* ch_thread::wtobjp |
Pointer to a generic "wait" object.
Definition at line 253 of file chobjects.h.
Referenced by __trace_switch(), chCondWaitS(), chCondWaitTimeoutS(), chMsgSend(), and chMtxLockS().
| thread_reference_t* ch_thread::wttrp |
Pointer to a generic thread reference object.
CH_STATE_SUSPENDED state. Definition at line 260 of file chobjects.h.
Referenced by __sch_wakeup(), chThdSuspendS(), and chThdSuspendTimeoutS().
| struct ch_semaphore* ch_thread::wtsemp |
Pointer to a generic semaphore object.
CH_STATE_WTSEM state. Definition at line 268 of file chobjects.h.
Referenced by __sch_wakeup(), chSemSignalWait(), chSemWaitS(), and chSemWaitTimeoutS().
| struct ch_mutex* ch_thread::wtmtxp |
Pointer to a generic mutex object.
CH_STATE_WTMTX state. Definition at line 277 of file chobjects.h.
Referenced by chMtxLockS().
| eventmask_t ch_thread::ewmask |
Enabled events mask.
CH_STATE_WTOREVT or CH_STATE_WTANDEVT states. Definition at line 285 of file chobjects.h.
Referenced by chEvtSignalI(), chEvtWaitAll(), chEvtWaitAllTimeout(), chEvtWaitAllTimeout(), chEvtWaitAny(), chEvtWaitAnyTimeout(), chEvtWaitAnyTimeout(), chEvtWaitOne(), and chEvtWaitOneTimeout().
| union { ... } ch_thread::u |
State-specific fields.
Referenced by __sch_ready_ahead(), __sch_ready_behind(), __sch_wakeup(), __trace_switch(), chCondBroadcastI(), chCondSignalI(), chCondWaitS(), chCondWaitTimeoutS(), chEvtSignalI(), chEvtWaitAll(), chEvtWaitAllTimeout(), chEvtWaitAny(), chEvtWaitAnyTimeout(), chEvtWaitOne(), chEvtWaitOneTimeout(), chMsgSend(), chMtxLockS(), chSchGoSleepTimeoutS(), chSchWakeupS(), chSemAddCounterI(), chSemResetWithMessageI(), chSemSignalI(), chSemSignalWait(), chSemWaitS(), chSemWaitTimeoutS(), chThdDoDequeueNextI(), chThdExitS(), chThdResumeI(), chThdSuspendS(), chThdSuspendTimeoutS(), and chThdWait().
| ch_list_t ch_thread::waiting |
Termination waiting list.
Definition at line 292 of file chobjects.h.
Referenced by __thd_object_init(), chThdExitS(), and chThdWait().
| ch_queue_t ch_thread::msgqueue |
Messages queue.
Definition at line 298 of file chobjects.h.
Referenced by __thd_object_init(), chMsgIsPendingI(), chMsgPollS(), chMsgSend(), chMsgWaitS(), and chMsgWaitTimeoutS().
| msg_t ch_thread::sentmsg |
Sent message.
u union even though it is only valid while the thread is in the CH_STATE_SNDMSG or CH_STATE_SNDMSGQ states. CH_CFG_USE_MESSAGES_PRIORITY is enabled, a thread blocked in CH_STATE_SNDMSGQ can be subject to priority inheritance: the PI walk in chMtxLockS() needs to re-enqueue the sender in the receiver's message queue after boosting its priority, and it does so by storing a back-pointer to that queue in u.wtobjp. At the same time chMsgGet() must still be able to read the sent message value until chMsgRelease() is called. Because both u.wtobjp and sentmsg must coexist while the thread is queued, placing sentmsg in the union would cause them to alias and corrupt each other. Definition at line 316 of file chobjects.h.
Referenced by chMsgGet(), and chMsgSend().
| eventmask_t ch_thread::epending |
Pending events mask.
Definition at line 322 of file chobjects.h.
Referenced by __thd_object_init(), chEvtGetAndClearEventsI(), chEvtSignalI(), chEvtWaitAll(), chEvtWaitAllTimeout(), chEvtWaitAny(), chEvtWaitAnyTimeout(), chEvtWaitOne(), and chEvtWaitOneTimeout().
| struct ch_mutex* ch_thread::mtxlist |
List of the mutexes owned by this thread.
NULL in this field. Definition at line 329 of file chobjects.h.
Referenced by __thd_object_init(), chMtxLockS(), chMtxTryLockS(), chMtxUnlock(), chMtxUnlockAllS(), and chMtxUnlockS().
| tprio_t ch_thread::realprio |
Thread's own, non-inherited, priority.
Definition at line 333 of file chobjects.h.
Referenced by __thd_object_init(), chMtxUnlock(), chMtxUnlockAllS(), chMtxUnlockS(), and chThdSetPriority().
| void* ch_thread::mpool |
Memory Pool where the thread workspace is returned.
Definition at line 340 of file chobjects.h.
Referenced by chThdCreateFromMemoryPool(), and chThdRelease().
| time_measurement_t ch_thread::stats |
Thread statistics.
Definition at line 346 of file chobjects.h.
Referenced by __stats_ctxswc(), __thd_object_init(), and chInstanceObjectInit().