Skip to content

Commit eb686b0

Browse files
authored
DPL: avoid busy looping when in Idle state (#4481)
Under certain conditions (most notably when an enumeration was provided and the device switched to "Idle" state) the libuv integration mistaken ly considered as activity any further enumeration, resulting in a busy loop. This makes sure we always UV_ONCE (i.e. wait for an external event) when in StreamingState::Idle.
1 parent dc5076b commit eb686b0

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

Framework/Core/src/DataProcessingDevice.cxx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -427,7 +427,7 @@ bool DataProcessingDevice::ConditionalRun()
427427
if (mState.loop) {
428428
ZoneScopedN("uv idle");
429429
TracyPlot("past activity", (int64_t)mWasActive);
430-
uv_run(mState.loop, mWasActive ? UV_RUN_NOWAIT : UV_RUN_ONCE);
430+
uv_run(mState.loop, mWasActive && (mDataProcessorContexes.at(0).state->streaming != StreamingState::Idle) ? UV_RUN_NOWAIT : UV_RUN_ONCE);
431431
}
432432

433433
// Notify on the main thread the new region callbacks, making sure

0 commit comments

Comments
 (0)