Skip to content

Commit

Permalink
Fix off-by-one in current thread waker refcount
Browse files Browse the repository at this point in the history
  • Loading branch information
tmiasko committed Feb 1, 2020
1 parent 9120c83 commit 1639d70
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/native/global.rs
Original file line number Diff line number Diff line change
Expand Up @@ -102,5 +102,5 @@ fn raw_drop(ptr: *const ()) {

fn current_thread_waker() -> Waker {
let thread = Arc::new(thread::current());
unsafe { Waker::from_raw(raw_clone(Arc::into_raw(thread) as *const ())) }
unsafe { Waker::from_raw(RawWaker::new(Arc::into_raw(thread) as *const (), &VTABLE)) }
}

0 comments on commit 1639d70

Please sign in to comment.