Skip to content

Commit

Permalink
change method names to not be wait
Browse files Browse the repository at this point in the history
  • Loading branch information
TheBlueMatt committed Feb 26, 2021
1 parent 1bb290e commit 1543730
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion background-processor/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ impl BackgroundProcessor {
let handle = thread::spawn(move || -> Result<(), std::io::Error> {
let mut current_time = Instant::now();
loop {
let updates_available = manager.wait_timeout(Duration::from_millis(100));
let updates_available = manager.await_persistable_update_timeout(Duration::from_millis(100));
if updates_available {
persist_manager(&*manager)?;
}
Expand Down
4 changes: 2 additions & 2 deletions lightning-c-bindings/src/ln/channelmanager.rs
Original file line number Diff line number Diff line change
Expand Up @@ -757,8 +757,8 @@ pub extern "C" fn ChannelManager_block_disconnected(this_arg: &ChannelManager, h
/// Blocks until ChannelManager needs to be persisted. Only one listener on `wait` is
/// guaranteed to be woken up.
#[no_mangle]
pub extern "C" fn ChannelManager_wait(this_arg: &ChannelManager) {
unsafe { &*this_arg.inner }.wait()
pub extern "C" fn ChannelManager_await_persistable_update(this_arg: &ChannelManager) {
unsafe { &*this_arg.inner }.await_persistable_update()
}

impl From<nativeChannelManager> for crate::ln::msgs::ChannelMessageHandler {
Expand Down
4 changes: 2 additions & 2 deletions lightning/src/ln/channelmanager.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3300,13 +3300,13 @@ impl<Signer: Sign, M: Deref, T: Deref, K: Deref, F: Deref, L: Deref> ChannelMana
/// guaranteed to be woken up.
/// Note that the feature `allow_wallclock_use` must be enabled to use this function.
#[cfg(any(test, feature = "allow_wallclock_use"))]
pub fn wait_timeout(&self, max_wait: Duration) -> bool {
pub fn await_persistable_update_timeout(&self, max_wait: Duration) -> bool {
self.persistence_notifier.wait_timeout(max_wait)
}

/// Blocks until ChannelManager needs to be persisted. Only one listener on `wait` is
/// guaranteed to be woken up.
pub fn wait(&self) {
pub fn await_persistable_update(&self) {
self.persistence_notifier.wait()
}

Expand Down

0 comments on commit 1543730

Please sign in to comment.