projects
/
rust-lightning
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Cache HTLC per_commitment_point in descriptor
[rust-lightning]
/
lightning
/
src
/
sync
/
nostd_sync.rs
diff --git
a/lightning/src/sync/nostd_sync.rs
b/lightning/src/sync/nostd_sync.rs
index 08d54a939be66ecccb83d30c0569d25f31a523e1..27cfb9b8f782c4bafabecd5180a5d0d2256105c3 100644
(file)
--- a/
lightning/src/sync/nostd_sync.rs
+++ b/
lightning/src/sync/nostd_sync.rs
@@
-49,7
+49,7
@@
impl<T> Mutex<T> {
impl<'a, T: 'a> LockTestExt<'a> for Mutex<T> {
#[inline]
fn held_by_thread(&self) -> LockHeldState {
impl<'a, T: 'a> LockTestExt<'a> for Mutex<T> {
#[inline]
fn held_by_thread(&self) -> LockHeldState {
- if self.
lock
().is_err() { return LockHeldState::HeldByThread; }
+ if self.
inner.try_borrow_mut
().is_err() { return LockHeldState::HeldByThread; }
else { return LockHeldState::NotHeldByThread; }
}
type ExclLock = MutexGuard<'a, T>;
else { return LockHeldState::NotHeldByThread; }
}
type ExclLock = MutexGuard<'a, T>;
@@
-115,7
+115,7
@@
impl<T> RwLock<T> {
impl<'a, T: 'a> LockTestExt<'a> for RwLock<T> {
#[inline]
fn held_by_thread(&self) -> LockHeldState {
impl<'a, T: 'a> LockTestExt<'a> for RwLock<T> {
#[inline]
fn held_by_thread(&self) -> LockHeldState {
- if self.
write
().is_err() { return LockHeldState::HeldByThread; }
+ if self.
inner.try_borrow_mut
().is_err() { return LockHeldState::HeldByThread; }
else { return LockHeldState::NotHeldByThread; }
}
type ExclLock = RwLockWriteGuard<'a, T>;
else { return LockHeldState::NotHeldByThread; }
}
type ExclLock = RwLockWriteGuard<'a, T>;