55#include "tick.h"
66
77/*! @addtogroup thread
8+
9+ Calico provides a simple preemptive multithreading system. Each thread is
10+ assigned a priority level and has its own execution state, allowing software
11+ to be better structured by having different processing tasks each in its own
12+ thread. Threads may wait on events such as interrupts. Calico ensures at all
13+ times that the currently running thread is always the highest priority thread
14+ that can run. If any event occurs that causes a higher priority thread to
15+ become runnable, Calico will preempt the current thread. Unlike in common PC
16+ operating systems, Calico presently does not implement timeslicing to share
17+ the CPU between threads of the same priority; meaning it is necessary to
18+ explicitly yield control of the CPU if any such threads exist.
19+
20+ While Calico provides its own threading API, it is also possible to use standard
21+ threading APIs such as POSIX threads or C++ threads. These APIs are in fact
22+ preferred when working with cross platform projects.
23+
824 @{
925*/
1026
@@ -14,8 +30,8 @@ typedef struct Thread Thread;
1430
1531//! List of blocked threads, used as a building block for synchronization primitives
1632typedef struct ThrListNode {
17- Thread * next ;
18- Thread * prev ;
33+ Thread * next ; //!< @private
34+ Thread * prev ; //!< @private
1935} ThrListNode ;
2036
2137//! @private
@@ -46,8 +62,8 @@ typedef int (* ThreadFunc)(void* arg);
4662struct Thread {
4763 ArmContext ctx ; //!< CPU context structure
4864
49- void * tp ; //!< Virtual thread pointer register
50- void * impure ; //!< @private
65+ void * tp ; //!< Virtual thread-local segment register
66+ void * impure ; //!< Pointer to per-thread C standard library state
5167
5268 Thread * next ; //!< @private
5369 ThrStatus status ; //!< @private
0 commit comments