Skip to content

Commit 231c179

Browse files
author
Gianmarco Garrisi
committed
Fix example
1 parent accf71f commit 231c179

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

examples/one_cpu.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ use desim::{Effect, EndCondition, Simulation};
1414
fn main() {
1515
let mut s = Simulation::new();
1616
let cpu = s.create_resource(Box::new(SimpleResource::new(1)));
17-
let p1 = s.create_process(Box::new(move |_| {
17+
let p1 = s.create_process(Box::new(#[coroutine] move |_| {
1818
for _ in 0..10 {
1919
// wait for the cpu to be available
2020
yield Effect::Request(cpu);
@@ -24,7 +24,7 @@ fn main() {
2424
yield Effect::Release(cpu);
2525
}
2626
}));
27-
let p2 = s.create_process(Box::new(move |_| {
27+
let p2 = s.create_process(Box::new(#[coroutine] move |_| {
2828
let mut rng = Rng::from_entropy();
2929
loop {
3030
// wait for the CPU

0 commit comments

Comments
 (0)