diff --git a/targets/RT/USER/lte-enb.c b/targets/RT/USER/lte-enb.c index 3a526a7380360703296f68f2676e0c8dd9d00568..d12cb3edb26f52129750fe982bc65f80ae56f44b 100644 --- a/targets/RT/USER/lte-enb.c +++ b/targets/RT/USER/lte-enb.c @@ -243,7 +243,17 @@ static inline int rxtx(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc, char *thread_nam VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_ENB_DLSCH_ULSCH_SCHEDULER , 0 ); if(oai_exit) return(-1); - if(get_nprocs() <= 4) phy_procedures_eNB_TX(eNB, proc, no_relay, NULL, 1); + if(get_nprocs() <= 4){ + phy_procedures_eNB_TX(eNB, proc, no_relay, NULL, 1); + pthread_mutex_lock( &proc[1].mutex_rxtx ); + proc[1].pipe_ready++; + // the thread can now be woken up + if (pthread_cond_signal(&proc[1].cond_rxtx) != 0) { + LOG_E( PHY, "[eNB] ERROR pthread_cond_signal for eNB TXnp4 thread\n"); + exit_fun( "ERROR pthread_cond_signal" ); + } + pthread_mutex_unlock( &proc[1].mutex_rxtx ); + } stop_meas( &softmodem_stats_rxtx_sf ); @@ -404,9 +414,17 @@ static void* eNB_thread_rxtx( void* param ) { } pthread_mutex_unlock( &proc->mutex_rxtx ); if(get_nprocs() >= 8) wakeup_tx(eNB,eNB->proc.ru_proc); - else if(get_nprocs() > 4) + else { phy_procedures_eNB_TX(eNB, proc, no_relay, NULL, 1); + pthread_mutex_lock( &proc[1].mutex_rxtx ); + proc[1].pipe_ready++; + // the thread can now be woken up + if (pthread_cond_signal(&proc[1].cond_rxtx) != 0) { + LOG_E( PHY, "[eNB] ERROR pthread_cond_signal for eNB TXnp4 thread\n"); + exit_fun( "ERROR pthread_cond_signal" ); + } + pthread_mutex_unlock( &proc->mutex_rxtx ); wakeup_txfh(proc,eNB->proc.ru_proc); } diff --git a/targets/RT/USER/lte-ru.c b/targets/RT/USER/lte-ru.c index ca2304e8bbc065bd7149fe502b3d0341cfe9d5d9..c634a12bb89941e506f68dc0d06526c65412514d 100644 --- a/targets/RT/USER/lte-ru.c +++ b/targets/RT/USER/lte-ru.c @@ -1940,6 +1940,8 @@ void kill_RU_proc(int inst) LOG_D(PHY, "Joining pthread_FH\n"); pthread_join(proc->pthread_FH, NULL); + LOG_D(PHY, "Joining pthread_FHTX\n"); + pthread_join(proc->pthread_FH1, NULL); if (ru->function == NGFI_RRU_IF4p5) { LOG_D(PHY, "Joining pthread_prach\n"); pthread_join(proc->pthread_prach, NULL); @@ -1990,15 +1992,18 @@ void kill_RU_proc(int inst) pthread_mutex_destroy(&proc->mutex_asynch_rxtx); pthread_mutex_destroy(&proc->mutex_synch); pthread_mutex_destroy(&proc->mutex_FH); + pthread_mutex_destroy(&proc->mutex_FH1); pthread_mutex_destroy(&proc->mutex_eNBs); pthread_cond_destroy(&proc->cond_prach); pthread_cond_destroy(&proc->cond_FH); + pthread_cond_destroy(&proc->cond_FH1); pthread_cond_destroy(&proc->cond_asynch_rxtx); pthread_cond_destroy(&proc->cond_synch); pthread_cond_destroy(&proc->cond_eNBs); pthread_attr_destroy(&proc->attr_FH); + pthread_attr_destroy(&proc->attr_FH1); pthread_attr_destroy(&proc->attr_prach); pthread_attr_destroy(&proc->attr_synch); pthread_attr_destroy(&proc->attr_asynch_rxtx);