Merge remote-tracking branch 'origin/bugfix-ue-realtime' into develop_integration_2019_w21

This commit is contained in:
Raphael Defosseux
2019-05-22 11:39:00 +02:00
5 changed files with 30 additions and 17 deletions
+19 -6
View File
@@ -1503,6 +1503,7 @@ void *UE_thread(void *arg) {
int i;
int th_id;
static uint8_t thread_idx = 0;
int ret;
cpu_set_t cpuset;
CPU_ZERO(&cpuset);
@@ -1724,15 +1725,27 @@ void *UE_thread(void *arg) {
}
pickTime(gotIQs);
struct timespec tv= {0};
tv.tv_nsec=10*1000;
if( IS_SOFTMODEM_BASICSIM || IS_SOFTMODEM_RFSIM)
tv.tv_sec=INT_MAX;
/* no timeout in IS_SOFTMODEM_BASICSIM or IS_SOFTMODEM_RFSIM mode */
if (IS_SOFTMODEM_BASICSIM || IS_SOFTMODEM_RFSIM) {
ret = pthread_mutex_lock(&proc->mutex_rxtx);
} else {
struct timespec tv;
if (clock_gettime(CLOCK_REALTIME, &tv) != 0) {
perror("clock_gettime");
exit(1);
}
tv.tv_nsec += 10*1000;
if (tv.tv_nsec >= 1000 * 1000 * 1000) {
tv.tv_sec++;
tv.tv_nsec -= 1000 * 1000 * 1000;
}
ret = pthread_mutex_timedlock(&proc->mutex_rxtx, &tv);
}
// operate on thread sf mod 2
if (pthread_mutex_timedlock(&proc->mutex_rxtx, &tv) !=0) {
if ( errno == ETIMEDOUT) {
if (ret != 0) {
if (ret == ETIMEDOUT) {
LOG_E(PHY,"Missed real time\n");
continue;
} else {