Skip to content

Commit

Permalink
Merge pull request #55 from tmiasko/current-thread-waker
Browse files Browse the repository at this point in the history
Fix off-by-one in current thread waker refcount
  • Loading branch information
yoshuawuyts committed Feb 17, 2020
2 parents 9120c83 + 1639d70 commit 954363a
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 954363a

Please sign in to comment.