Merge pull request #42 from Tony-X/patch-1

Fix the example in chapter 6 to compile
This commit is contained in:
Carl Fredrik Samson
2022-01-25 20:53:45 +01:00
committed by GitHub

View File

@@ -168,7 +168,7 @@ const VTABLE: RawWakerVTable = unsafe {
RawWakerVTable::new( RawWakerVTable::new(
|s| mywaker_clone(&*(s as *const MyWaker)), // clone |s| mywaker_clone(&*(s as *const MyWaker)), // clone
|s| mywaker_wake(&*(s as *const MyWaker)), // wake |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 |s| drop(Arc::from_raw(s as *const MyWaker)), // decrease refcount
) )
}; };