Skip to content

Commit

Permalink
Fix example
Browse files Browse the repository at this point in the history
  • Loading branch information
Gianmarco Garrisi committed Sep 23, 2024
1 parent accf71f commit 231c179
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions examples/one_cpu.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ use desim::{Effect, EndCondition, Simulation};
fn main() {
let mut s = Simulation::new();
let cpu = s.create_resource(Box::new(SimpleResource::new(1)));
let p1 = s.create_process(Box::new(move |_| {
let p1 = s.create_process(Box::new(#[coroutine] move |_| {
for _ in 0..10 {
// wait for the cpu to be available
yield Effect::Request(cpu);
Expand All @@ -24,7 +24,7 @@ fn main() {
yield Effect::Release(cpu);
}
}));
let p2 = s.create_process(Box::new(move |_| {
let p2 = s.create_process(Box::new(#[coroutine] move |_| {
let mut rng = Rng::from_entropy();
loop {
// wait for the CPU
Expand Down

0 comments on commit 231c179

Please sign in to comment.