From 8e1bb6bcd90fecc0936172639782907fa259a4bd Mon Sep 17 00:00:00 2001 From: Tony-X Date: Mon, 24 Jan 2022 18:24:09 -0800 Subject: [PATCH] Fix the example in chapter 6 to compile Before we introduced the better `Parker` we were using a thread. The example code for executor need to use `thread` instead of `parker` --- src/6_future_example.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/6_future_example.md b/src/6_future_example.md index ff7b54a..536bad9 100644 --- a/src/6_future_example.md +++ b/src/6_future_example.md @@ -168,7 +168,7 @@ const VTABLE: RawWakerVTable = unsafe { RawWakerVTable::new( |s| mywaker_clone(&*(s as *const MyWaker)), // clone |s| mywaker_wake(&*(s as *const MyWaker)), // wake - |s| (*(s as *const MyWaker)).parker.unpark(), // wake by ref (don't decrease refcount) + |s| (*(s as *const MyWaker)).thread.unpark(), // wake by ref (don't decrease refcount) |s| drop(Arc::from_raw(s as *const MyWaker)), // decrease refcount ) };