Skip to content

Commit ae4f619

Browse files
committed
Add a constructor to MultiThreadedLockableScore
...as otherwise the struct is rather useless.
1 parent 2a8a396 commit ae4f619

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

lightning/src/routing/scoring.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,14 @@ impl<'a, T: Score + 'a> LockableScore<'a> for MultiThreadedLockableScore<T> {
168168
}
169169
}
170170

171+
#[cfg(c_bindings)]
172+
impl<T: Score> MultiThreadedLockableScore<T> {
173+
/// Creates a new [`MultiThreadedLockableScore`] given an underlying [`Score`].
174+
pub fn new(score: T) -> Self {
175+
MultiThreadedLockableScore { score: Mutex::new(score) }
176+
}
177+
}
178+
171179
#[cfg(c_bindings)]
172180
/// (C-not exported)
173181
impl<'a, T: Writeable> Writeable for RefMut<'a, T> {

0 commit comments

Comments
 (0)