Skip to content

Commit 1dfa4c2

Browse files
committed
samples: work-philosophers: Fox Mutex lock missing on stats
The stats is returned still in the Arc<Mutex<_>> to avoid an extra copy of the large stat structure. Add the lock to allow for this. Signed-off-by: David Brown <[email protected]>
1 parent ef401dc commit 1dfa4c2

File tree

1 file changed

+1
-1
lines changed
  • samples/work-philosophers/src

1 file changed

+1
-1
lines changed

samples/work-philosophers/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ extern "C" fn rust_main() {
6363
let handle = spawn(hand_sem::phil(&worker), &worker, c"hand-sem");
6464
let stats = handle.join();
6565
printkln!("Done with hand-sem test");
66-
stats.show();
66+
stats.lock().unwrap().show();
6767

6868
// First run the async semaphore based one.
6969
printkln!("Running 'async-sem' test");

0 commit comments

Comments
 (0)