Deadlock avoidance in rfsimulator

This commit is contained in:
Bartosz Podrygajlo
2025-01-31 15:47:41 +01:00
parent 64a472aef1
commit fd20068f26
+7 -1
View File
@@ -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);
}