From fd20068f269e059441e545ba9055069404a7922c Mon Sep 17 00:00:00 2001 From: Bartosz Podrygajlo Date: Fri, 31 Jan 2025 15:47:41 +0100 Subject: [PATCH] Deadlock avoidance in rfsimulator --- radio/rfsimulator/simulator.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/radio/rfsimulator/simulator.c b/radio/rfsimulator/simulator.c index faa185a0cb..262cb87deb 100644 --- a/radio/rfsimulator/simulator.c +++ b/radio/rfsimulator/simulator.c @@ -973,7 +973,7 @@ static int rfsimulator_read(openair0_device *device, openair0_timestamp *ptimest } } else { bool have_to_wait; - + int loops = 0; do { have_to_wait=false; @@ -995,6 +995,12 @@ static int rfsimulator_read(openair0_device *device, openair0_timestamp *ptimest t->nextRxTstamp + nsamps); flushInput(t, 3, nsamps); } + if (loops++ > 10 && t->role == SIMU_ROLE_SERVER) { + // Just start producing samples. The clients will catch up. + have_to_wait = false; + LOG_W(HW, + "No longer waiting for clients to catch up, starting to produce samples\n"); + } } while (have_to_wait); }