Allow non-mut register and wake
This commit is contained in:
parent
553432a8e8
commit
ec9b51833c
@ -61,7 +61,7 @@ impl AtomicWaker {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// Register a waker. Overwrites the previous waker, if any.
|
/// Register a waker. Overwrites the previous waker, if any.
|
||||||
pub fn register(&mut self, w: &Waker) {
|
pub fn register(&self, w: &Waker) {
|
||||||
critical_section::with(|cs| {
|
critical_section::with(|cs| {
|
||||||
let cell = self.waker.borrow(cs);
|
let cell = self.waker.borrow(cs);
|
||||||
cell.set(match cell.replace(None) {
|
cell.set(match cell.replace(None) {
|
||||||
@ -72,7 +72,7 @@ impl AtomicWaker {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// Wake the registered waker, if any.
|
/// Wake the registered waker, if any.
|
||||||
pub fn wake(&mut self) {
|
pub fn wake(&self) {
|
||||||
critical_section::with(|cs| {
|
critical_section::with(|cs| {
|
||||||
let cell = self.waker.borrow(cs);
|
let cell = self.waker.borrow(cs);
|
||||||
if let Some(w) = cell.replace(None) {
|
if let Some(w) = cell.replace(None) {
|
||||||
|
Loading…
Reference in New Issue
Block a user