@@ -12,6 +12,7 @@ use crate::utils::{
12
12
Init , PrioBitmap ,
13
13
} ;
14
14
15
+ #[ cfg_attr( doc, svgbobdoc:: transform) ]
15
16
/// Represents a single task in a system.
16
17
///
17
18
/// This type is ABI-compatible with [`Id`].
@@ -25,15 +26,43 @@ use crate::utils::{
25
26
///
26
27
/// A task may be in one of the following states:
27
28
///
28
- /// - **Dormant**
29
- /// - **Ready**
30
- /// - **Running**
31
- /// - **Waiting**
29
+ /// - **Dormant** — The task is not executing, doesn't have an associated
30
+ /// execution [thread], and can be [activated].
32
31
///
33
- #[ doc( include = "../common.md" ) ]
32
+ /// - **Ready** — The task has an associated execution thread, which is ready to
33
+ /// be scheduled to the CPU
34
+ ///
35
+ /// - **Running** — The task has an associated execution thread, which is
36
+ /// currently scheduled to the CPU
37
+ ///
38
+ /// - **Waiting** — The task has an associated execution thread, which is
39
+ /// currently blocked by a blocking operation
40
+ ///
41
+ /// ```svgbob
42
+ /// ,-------,
43
+ /// ,--------------->| Ready |<--------------,
44
+ /// | '-------' |
45
+ /// | dispatch | ^ |
46
+ /// | | | |
47
+ /// | release | | | activate
48
+ /// ,---------, | | ,---------,
49
+ /// | Waiting | | | | Dormant |
50
+ /// '---------' | | '---------'
51
+ /// ^ | | ^
52
+ /// | | | |
53
+ /// | v | preempt |
54
+ /// | wait ,---------, |
55
+ /// '---------------| Running |--------------'
56
+ /// '---------' exit
57
+ /// ```
58
+ ///
59
+ /// [thread]: crate#threads
60
+ /// [activated]: Task::activate
34
61
#[ repr( transparent) ]
35
62
pub struct Task < System > ( Id , PhantomData < System > ) ;
36
63
64
+ // FIXME: `svgbobdoc` doesn't like `#[doc(include = ...)]`
65
+ #[ doc( include = "../common.md" ) ]
37
66
impl < System > Clone for Task < System > {
38
67
fn clone ( & self ) -> Self {
39
68
Self ( self . 0 , self . 1 )
0 commit comments