Fix `held_by_thread` in `no-std` to return instead of panicing
authorMatt Corallo <git@bluematt.me>
Tue, 30 May 2023 18:11:47 +0000 (18:11 +0000)
committerMatt Corallo <git@bluematt.me>
Tue, 30 May 2023 18:15:32 +0000 (18:15 +0000)
commit660daaacdf862743b318ee85673900f91591d036
treea98599502de9092b8ceca879d1d801e9f0d9acbe
parent9e542ec8c778ced54bd4d792ce17e6dbda385342
Fix `held_by_thread` in `no-std` to return instead of panicing

Our `no-std` locks simply panic if a lock cannot be taken as there
should be no lock contention in a single-threaded environment.
However, the `held_by_thread` debug methods were delegating to the
lock methods which resulted in a panic when asserting that a lock
*is* held by the current thread.

Instead, they are updated here to call the relevant `RefCell`
testing methods.
lightning/src/sync/nostd_sync.rs