first try to add a function to the usrp_lib to set the thread priority
This commit is contained in:
@@ -98,7 +98,7 @@ typedef int(*devfunc_t)(openair0_device *, openair0_config_t *, eth_params_t *);
|
||||
/* look for the interface library and load it */
|
||||
int load_lib(openair0_device *device, openair0_config_t *openair0_cfg, eth_params_t * cfg, uint8_t flag) {
|
||||
|
||||
loader_shlibfunc_t shlib_fdesc[1];
|
||||
loader_shlibfunc_t shlib_fdesc[2];
|
||||
int ret=0;
|
||||
char *libname;
|
||||
if (flag == RAU_LOCAL_RADIO_HEAD) {
|
||||
@@ -107,15 +107,17 @@ int load_lib(openair0_device *device, openair0_config_t *openair0_cfg, eth_param
|
||||
else
|
||||
libname=OAI_RF_LIBNAME;
|
||||
shlib_fdesc[0].fname="device_init";
|
||||
shlib_fdesc[1].fname="uhd_set_thread_priority";
|
||||
} else {
|
||||
libname=OAI_TP_LIBNAME;
|
||||
shlib_fdesc[0].fname="transport_init";
|
||||
}
|
||||
ret=load_module_shlib(libname,shlib_fdesc,1,NULL);
|
||||
ret=load_module_shlib(libname,shlib_fdesc,2,NULL);
|
||||
if (ret < 0) {
|
||||
LOG_E(HW,"Library %s couldn't be loaded\n",libname);
|
||||
} else {
|
||||
ret=((devfunc_t)shlib_fdesc[0].fptr)(device,openair0_cfg,cfg);
|
||||
uhd_set_thread_priority_fun = (set_prio_func_t)shlib_fdesc[1].fptr;
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -445,6 +445,10 @@ int openair0_set_rx_frequencies(openair0_device *device, openair0_config_t *open
|
||||
#define gettid() syscall(__NR_gettid)
|
||||
/*@}*/
|
||||
|
||||
void uhd_set_thread_priority(void);
|
||||
typedef void(*set_prio_func_t)(void);
|
||||
set_prio_func_t uhd_set_thread_priority_fun;
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -1461,5 +1461,10 @@ extern "C" {
|
||||
#endif
|
||||
return 0;
|
||||
}
|
||||
|
||||
void uhd_set_thread_priority(void) {
|
||||
uhd::set_thread_priority_safe(1.0);
|
||||
}
|
||||
|
||||
}
|
||||
/*@}*/
|
||||
|
||||
@@ -1285,6 +1285,7 @@ static void* ru_thread_tx( void* param ) {
|
||||
|
||||
wait_on_condition(&proc->mutex_FH1,&proc->cond_FH1,&proc->instance_cnt_FH1,"ru_thread_tx");
|
||||
|
||||
uhd_set_thread_priority_fun();
|
||||
|
||||
while (!oai_exit) {
|
||||
|
||||
|
||||
Reference in New Issue
Block a user