hsclient state: Move error inspection before guard re-lock.
This is still correct from a lock hierarchy pov. It moves the guard relock to the end, which is going to be necessary since it is going to have to move right outside the loop.
This commit is contained in:
parent
1e905763e3
commit
4f5f378516
|
@ -235,16 +235,17 @@ impl<D: MockableConnectorData> Services<D> {
|
|||
drop(guard);
|
||||
// Wait for the task to complete (at which point it drops the barrier)
|
||||
barrier_recv.recv().await;
|
||||
guard = connector
|
||||
.services
|
||||
.lock()
|
||||
.map_err(|_| internal!("HS connector poisoned (relock)"))?;
|
||||
let error = error
|
||||
.lock()
|
||||
.map_err(|_| internal!("Working error poisoned"))?;
|
||||
if let Some(error) = &*error {
|
||||
return Err(error.clone());
|
||||
}
|
||||
drop(error);
|
||||
guard = connector
|
||||
.services
|
||||
.lock()
|
||||
.map_err(|_| internal!("HS connector poisoned (relock)"))?;
|
||||
continue;
|
||||
}
|
||||
ServiceState::Closed { .. } => {
|
||||
|
|
Loading…
Reference in New Issue