Package org.ldk.structs
Class LockableScore
- java.lang.Object
-
- org.ldk.structs.LockableScore
-
public class LockableScore extends Object
A scorer that is accessed under a lock. Needed so that calls to [`Score::channel_penalty_msat`] in [`find_route`] can be made while having shared ownership of a scorer but without requiring internal locking in [`Score`] implementations. Internal locking would be detrimental to route finding performance and could result in [`Score::channel_penalty_msat`] returning a different value for the same channel. [`find_route`]: crate::routing::router::find_route
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interface
LockableScore.LockableScoreInterface
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
destroy()
Destroys the object, freeing associated resources.protected void
finalize()
Score
lock()
Returns the locked scorer.static LockableScore
new_impl(LockableScore.LockableScoreInterface arg)
-
-
-
Method Detail
-
finalize
protected void finalize() throws Throwable
-
destroy
public void destroy()
Destroys the object, freeing associated resources. After this call, any access to this object may result in a SEGFAULT or worse. You should generally NEVER call this method. You should let the garbage collector do this for you when it finalizes objects. However, it may be useful for types which represent locks and should be closed immediately to avoid holding locks until the GC runs.
-
new_impl
public static LockableScore new_impl(LockableScore.LockableScoreInterface arg)
-
lock
public Score lock()
Returns the locked scorer.
-
-