File tree Expand file tree Collapse file tree 2 files changed +8
-43
lines changed Expand file tree Collapse file tree 2 files changed +8
-43
lines changed Original file line number Diff line number Diff line change 1
1
[package ]
2
2
name = " scheduler"
3
- version = " 0.1 .0"
3
+ version = " 0.2 .0"
4
4
edition = " 2021"
5
5
authors = [" Yuekai Jia <equation618@gmail.com>" ]
6
6
description = " Various scheduler algorithms in a unified interface"
@@ -10,5 +10,4 @@ repository = "https://github.com/arceos-org/scheduler"
10
10
documentation = " https://arceos-org.github.io/scheduler"
11
11
12
12
[dependencies ]
13
- linked_list = { git = " https://github.com/arceos-org/linked_list.git" , tag = " v0.1.0" }
14
-
13
+ linked_list_r4l = { version = " 0.2.0" }
Original file line number Diff line number Diff line change 1
1
use alloc:: sync:: Arc ;
2
- use core:: ops:: Deref ;
3
2
4
- use linked_list :: { Adapter , Links , List } ;
3
+ use linked_list_r4l :: { def_node , List } ;
5
4
6
5
use crate :: BaseScheduler ;
7
6
8
- /// A task wrapper for the [`FifoScheduler`].
9
- ///
10
- /// It add extra states to use in [`linked_list::List`].
11
- pub struct FifoTask < T > {
12
- inner : T ,
13
- links : Links < Self > ,
14
- }
15
-
16
- unsafe impl < T > Adapter for FifoTask < T > {
17
- type EntryType = Self ;
18
-
19
- #[ inline]
20
- fn to_links ( t : & Self ) -> & Links < Self > {
21
- & t. links
22
- }
23
- }
24
-
25
- impl < T > FifoTask < T > {
26
- /// Creates a new [`FifoTask`] from the inner task struct.
27
- pub const fn new ( inner : T ) -> Self {
28
- Self {
29
- inner,
30
- links : Links :: new ( ) ,
31
- }
32
- }
33
-
34
- /// Returns a reference to the inner task struct.
35
- pub const fn inner ( & self ) -> & T {
36
- & self . inner
37
- }
38
- }
39
-
40
- impl < T > Deref for FifoTask < T > {
41
- type Target = T ;
42
- #[ inline]
43
- fn deref ( & self ) -> & Self :: Target {
44
- & self . inner
45
- }
7
+ def_node ! {
8
+ /// A task wrapper for the [`FifoScheduler`].
9
+ ///
10
+ /// It add extra states to use in [`linked_list::List`].
11
+ pub struct FifoTask <T >( T ) ;
46
12
}
47
13
48
14
/// A simple FIFO (First-In-First-Out) cooperative scheduler.
You can’t perform that action at this time.
0 commit comments