mirror of
https://github.com/stakwork/sphinx-key.git
synced 2025-12-17 07:14:23 +01:00
feat/lss
This commit is contained in:
@@ -140,17 +140,15 @@ impl<C: 'static + Client> SignerLoop<C> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fn handle_message(&mut self, message: Vec<u8>, catch_init: bool) -> Result<Vec<u8>> {
|
fn handle_message(&mut self, message: Vec<u8>, catch_init: bool) -> Result<Vec<u8>> {
|
||||||
// let l = self.lock.lock().unwrap();
|
// wait until not busy
|
||||||
loop {
|
loop {
|
||||||
let is_busy = self.busy.load(Ordering::Relaxed);
|
match self
|
||||||
if !is_busy {
|
.busy
|
||||||
// busy now!
|
.compare_exchange(false, true, Ordering::Acquire, Ordering::Relaxed)
|
||||||
self.busy.store(true, Ordering::Relaxed);
|
{
|
||||||
break;
|
Ok(_) => break,
|
||||||
} else {
|
Err(_) => thread::sleep(Duration::from_millis(5)),
|
||||||
// wait 5 ms
|
};
|
||||||
thread::sleep(Duration::from_millis(5));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
let dbid = self.client_id.as_ref().map(|c| c.dbid).unwrap_or(0);
|
let dbid = self.client_id.as_ref().map(|c| c.dbid).unwrap_or(0);
|
||||||
|
|||||||
Reference in New Issue
Block a user