Commit 658aa001 authored by WANG Tsu-Han's avatar WANG Tsu-Han

bug fix for threading with under 8core

parent eee76738
...@@ -243,7 +243,17 @@ static inline int rxtx(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc, char *thread_nam ...@@ -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 ); VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_ENB_DLSCH_ULSCH_SCHEDULER , 0 );
if(oai_exit) return(-1); 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 ); stop_meas( &softmodem_stats_rxtx_sf );
...@@ -404,9 +414,17 @@ static void* eNB_thread_rxtx( void* param ) { ...@@ -404,9 +414,17 @@ static void* eNB_thread_rxtx( void* param ) {
} }
pthread_mutex_unlock( &proc->mutex_rxtx ); pthread_mutex_unlock( &proc->mutex_rxtx );
if(get_nprocs() >= 8) wakeup_tx(eNB,eNB->proc.ru_proc); 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); 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); wakeup_txfh(proc,eNB->proc.ru_proc);
} }
......
...@@ -1940,6 +1940,8 @@ void kill_RU_proc(int inst) ...@@ -1940,6 +1940,8 @@ void kill_RU_proc(int inst)
LOG_D(PHY, "Joining pthread_FH\n"); LOG_D(PHY, "Joining pthread_FH\n");
pthread_join(proc->pthread_FH, NULL); 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) { if (ru->function == NGFI_RRU_IF4p5) {
LOG_D(PHY, "Joining pthread_prach\n"); LOG_D(PHY, "Joining pthread_prach\n");
pthread_join(proc->pthread_prach, NULL); pthread_join(proc->pthread_prach, NULL);
...@@ -1990,15 +1992,18 @@ void kill_RU_proc(int inst) ...@@ -1990,15 +1992,18 @@ void kill_RU_proc(int inst)
pthread_mutex_destroy(&proc->mutex_asynch_rxtx); pthread_mutex_destroy(&proc->mutex_asynch_rxtx);
pthread_mutex_destroy(&proc->mutex_synch); pthread_mutex_destroy(&proc->mutex_synch);
pthread_mutex_destroy(&proc->mutex_FH); pthread_mutex_destroy(&proc->mutex_FH);
pthread_mutex_destroy(&proc->mutex_FH1);
pthread_mutex_destroy(&proc->mutex_eNBs); pthread_mutex_destroy(&proc->mutex_eNBs);
pthread_cond_destroy(&proc->cond_prach); pthread_cond_destroy(&proc->cond_prach);
pthread_cond_destroy(&proc->cond_FH); pthread_cond_destroy(&proc->cond_FH);
pthread_cond_destroy(&proc->cond_FH1);
pthread_cond_destroy(&proc->cond_asynch_rxtx); pthread_cond_destroy(&proc->cond_asynch_rxtx);
pthread_cond_destroy(&proc->cond_synch); pthread_cond_destroy(&proc->cond_synch);
pthread_cond_destroy(&proc->cond_eNBs); pthread_cond_destroy(&proc->cond_eNBs);
pthread_attr_destroy(&proc->attr_FH); pthread_attr_destroy(&proc->attr_FH);
pthread_attr_destroy(&proc->attr_FH1);
pthread_attr_destroy(&proc->attr_prach); pthread_attr_destroy(&proc->attr_prach);
pthread_attr_destroy(&proc->attr_synch); pthread_attr_destroy(&proc->attr_synch);
pthread_attr_destroy(&proc->attr_asynch_rxtx); pthread_attr_destroy(&proc->attr_asynch_rxtx);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment