You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
use futures::task::noop_waker_ref;fnmain(){let waker = std::thread::spawn(|| noop_waker_ref()).join().unwrap();
waker.wake_by_ref();}
noop_waker_ref() returns a 'static reference into TLS, but Waker is Sync so &'static Waker is Send, allowing the reference to outlive the thread it came from.
It should use something more like a lazy_static.
The text was updated successfully, but these errors were encountered:
Demo which segfaults in playground:
noop_waker_ref()
returns a'static
reference into TLS, butWaker
isSync
so&'static Waker
isSend
, allowing the reference to outlive the thread it came from.It should use something more like a lazy_static.
The text was updated successfully, but these errors were encountered: