Replaced usleep with semaphore for current_sfn_sf

This commit is contained in:
RS
2020-07-10 15:05:02 -07:00
parent 9a8880fd39
commit 7b387999b3
4 changed files with 23 additions and 1 deletions
+5 -1
View File
@@ -1043,7 +1043,11 @@ static void *UE_phy_stub_standalone_pnf_task(void *arg)
bool sent_any = false;
int sfn_sf = current_sfn_sf;
if (sfn_sf == last_sfn_sf) {
usleep(100);
if (sem_wait(&sfn_semaphore) != 0)
{
LOG_E(MAC, "sem_wait() error\n");
abort();
}
continue;
}
+8
View File
@@ -733,7 +733,15 @@ int main( int argc, char **argv ) {
init_queue(&tx_req_pdu_queue);
init_queue(&hi_dci0_req_queue);
init_queue(&ul_config_req_queue);
config_sync_var=0;
if (sem_init(&sfn_semaphore, 0, 0) != 0)
{
LOG_E(MAC, "sem_init() error\n");
abort();
}
init_UE_stub_single_thread(NB_UE_INST,eMBMS_active,uecap_xer_in,emul_iface);
init_UE_standalone_thread();
} else {