Skip to content

Commit 686208b

Browse files
committed
Change ChannelManager::wait to be more descriptive
`wait` doesn't capture enough of what's going on, but also Java Java doesn't accpet methods just called `wait`, as it conflicts with existing sync primitives on all Objects.
1 parent 8a4b001 commit 686208b

File tree

4 files changed

+6
-6
lines changed

4 files changed

+6
-6
lines changed

background-processor/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ impl BackgroundProcessor {
6666
let handle = thread::spawn(move || -> Result<(), std::io::Error> {
6767
let mut current_time = Instant::now();
6868
loop {
69-
let updates_available = manager.wait_timeout(Duration::from_millis(100));
69+
let updates_available = manager.await_persistable_update_timeout(Duration::from_millis(100));
7070
if updates_available {
7171
persist_manager(&*manager)?;
7272
}

lightning-c-bindings/include/lightning.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6140,7 +6140,7 @@ void ChannelManager_block_disconnected(const struct LDKChannelManager *NONNULL_P
61406140
* Blocks until ChannelManager needs to be persisted. Only one listener on `wait` is
61416141
* guaranteed to be woken up.
61426142
*/
6143-
void ChannelManager_wait(const struct LDKChannelManager *NONNULL_PTR this_arg);
6143+
void ChannelManager_await_persistable_update(const struct LDKChannelManager *NONNULL_PTR this_arg);
61446144

61456145
struct LDKChannelMessageHandler ChannelManager_as_ChannelMessageHandler(const struct LDKChannelManager *NONNULL_PTR this_arg);
61466146

lightning-c-bindings/src/ln/channelmanager.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -872,8 +872,8 @@ pub extern "C" fn ChannelManager_block_disconnected(this_arg: &ChannelManager, h
872872
/// Blocks until ChannelManager needs to be persisted. Only one listener on `wait` is
873873
/// guaranteed to be woken up.
874874
#[no_mangle]
875-
pub extern "C" fn ChannelManager_wait(this_arg: &ChannelManager) {
876-
unsafe { &*this_arg.inner }.wait()
875+
pub extern "C" fn ChannelManager_await_persistable_update(this_arg: &ChannelManager) {
876+
unsafe { &*this_arg.inner }.await_persistable_update()
877877
}
878878

879879
impl From<nativeChannelManager> for crate::ln::msgs::ChannelMessageHandler {

lightning/src/ln/channelmanager.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3411,13 +3411,13 @@ impl<Signer: Sign, M: Deref, T: Deref, K: Deref, F: Deref, L: Deref> ChannelMana
34113411
/// guaranteed to be woken up.
34123412
/// Note that the feature `allow_wallclock_use` must be enabled to use this function.
34133413
#[cfg(any(test, feature = "allow_wallclock_use"))]
3414-
pub fn wait_timeout(&self, max_wait: Duration) -> bool {
3414+
pub fn await_persistable_update_timeout(&self, max_wait: Duration) -> bool {
34153415
self.persistence_notifier.wait_timeout(max_wait)
34163416
}
34173417

34183418
/// Blocks until ChannelManager needs to be persisted. Only one listener on `wait` is
34193419
/// guaranteed to be woken up.
3420-
pub fn wait(&self) {
3420+
pub fn await_persistable_update(&self) {
34213421
self.persistence_notifier.wait()
34223422
}
34233423

0 commit comments

Comments
 (0)