From a28ae2a79d36ed5f37ea1c18fcb34a0291f3cbe4 Mon Sep 17 00:00:00 2001 From: roux Date: Mon, 13 Jul 2015 15:52:27 +0000 Subject: [PATCH] Fix a bug. If phy_procedures_eNB_TX exits with the lock acquired, lte-softmodem will never finish properly. git-svn-id: http://svn.eurecom.fr/openair4G/trunk@7703 818b1a75-f10b-46b9-bf7c-635c3b92a50f --- targets/RT/USER/lte-softmodem.c | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/targets/RT/USER/lte-softmodem.c b/targets/RT/USER/lte-softmodem.c index d42f092607..84ff023e69 100644 --- a/targets/RT/USER/lte-softmodem.c +++ b/targets/RT/USER/lte-softmodem.c @@ -1150,17 +1150,22 @@ static void* eNB_thread_tx( void* param ) &sync_phy_proc[proc->subframe].mutex_phy_proc_tx); } - if (oai_exit) { - if (pthread_mutex_unlock(&sync_phy_proc[proc->subframe].mutex_phy_proc_tx) != 0) { - LOG_E(PHY, "[SCHED][eNB] error unlocking PHY proc mutex for eNB TX proc %d\n", proc->subframe); - exit_fun("nothing to add"); - } - break; + if (pthread_mutex_unlock(&sync_phy_proc[proc->subframe].mutex_phy_proc_tx) != 0) { + LOG_E(PHY, "[SCHED][eNB] error unlocking PHY proc mutex for eNB TX proc %d\n", proc->subframe); + exit_fun("nothing to add"); } + if (oai_exit) + break; + phy_procedures_eNB_TX( proc->subframe, PHY_vars_eNB_g[0][proc->CC_id], 0, no_relay, NULL ); /* we're done, let the next one proceed */ + if (pthread_mutex_lock(&sync_phy_proc[proc->subframe].mutex_phy_proc_tx) != 0) { + LOG_E(PHY, "[SCHED][eNB] error locking PHY proc mutex for eNB TX proc %d\n", proc->subframe); + exit_fun("nothing to add"); + break; + } sync_phy_proc[proc->subframe].phy_proc_CC_id++; sync_phy_proc[proc->subframe].phy_proc_CC_id %= MAX_NUM_CCs; pthread_cond_broadcast(&sync_phy_proc[proc->subframe].cond_phy_proc_tx);