fix capture termination when in client creation

This commit is contained in:
Ferdinand Schober
2024-10-28 17:51:10 +01:00
parent 095937e943
commit 151fbe37de
2 changed files with 8 additions and 2 deletions

View File

@@ -182,7 +182,10 @@ async fn do_capture(
/* create barriers for active clients */
for (handle, pos) in clients {
capture.create(handle, to_capture_pos(pos)).await?;
tokio::select! {
r = capture.create(handle, to_capture_pos(pos)) => r?,
_ = wait_for_termination(request_rx) => return Ok(()),
}
}
let res = do_capture_session(active, &mut capture, conn, event_tx, request_rx, service).await;

View File

@@ -288,7 +288,10 @@ impl EmulationProxy {
// create active handles
for &handle in handles.values() {
emulation.create(handle).await;
tokio::select! {
_ = emulation.create(handle) => {},
_ = wait_for_termination(request_rx) => return Ok(()),
}
}
let res = Self::do_emulation_session(&mut emulation, handles, next_id, request_rx).await;