Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
O
OpenXG-RAN
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
promise
OpenXG-RAN
Commits
3720aa05
Commit
3720aa05
authored
Jun 04, 2019
by
Wang Tsu-Han
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
assersion condition and timedlock overflow fix
parent
7ed11406
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
33 additions
and
16 deletions
+33
-16
openair1/PHY/defs_common.h
openair1/PHY/defs_common.h
+7
-2
targets/RT/USER/lte-enb.c
targets/RT/USER/lte-enb.c
+1
-0
targets/RT/USER/lte-ru.c
targets/RT/USER/lte-ru.c
+25
-14
No files found.
openair1/PHY/defs_common.h
View file @
3720aa05
...
...
@@ -1099,10 +1099,15 @@ static inline int timedwait_on_condition(pthread_mutex_t *mutex,pthread_cond_t *
// proc->instance_cnt_rxtx is -1
abstime
.
tv_sec
=
now
.
tv_sec
;
abstime
.
tv_nsec
=
now
.
tv_nsec
+
time_ns
;
if
((
waitret
=
pthread_cond_timedwait
(
cond
,
mutex
,
&
abstime
))
==
ETIMEDOUT
)
break
;
// this unlocks mutex_rxtx while waiting and then locks it again
if
(
abstime
.
tv_nsec
>=
1000
*
1000
*
1000
)
{
abstime
.
tv_nsec
-=
1000
*
1000
*
1000
;
abstime
.
tv_sec
+=
1
;
}
if
((
waitret
=
pthread_cond_timedwait
(
cond
,
mutex
,
&
abstime
))
==
0
)
break
;
// this unlocks mutex_rxtx while waiting and then locks it again
}
AssertFatal
((
rc
=
pthread_mutex_unlock
(
mutex
))
==
0
,
"[SCHED][eNB] timedwait_on_condition(): error unlocking mutex return %d for %s
\n
"
,
rc
,
name
);
AssertFatal
((
rc
=
pthread_mutex_unlock
(
mutex
))
==
0
,
"[SCHED][eNB] timedwait_on_condition(): error unlocking mutex return %d for %s
\n
"
,
rc
,
name
);
return
(
0
);
}
...
...
targets/RT/USER/lte-enb.c
View file @
3720aa05
...
...
@@ -420,6 +420,7 @@ static void *L1_thread( void *param ) {
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME
(
VCD_SIGNAL_DUMPER_VARIABLES_SUBFRAME_NUMBER_RX0_ENB
,
proc
->
subframe_rx
);
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME
(
VCD_SIGNAL_DUMPER_VARIABLES_FRAME_NUMBER_TX0_ENB
,
proc
->
frame_tx
);
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME
(
VCD_SIGNAL_DUMPER_VARIABLES_FRAME_NUMBER_RX0_ENB
,
proc
->
frame_rx
);
if
(
oai_exit
)
break
;
...
...
targets/RT/USER/lte-ru.c
View file @
3720aa05
...
...
@@ -862,7 +862,12 @@ void wakeup_slaves(RU_proc_t *proc) {
// lock the FH mutex and make sure the thread is ready
clock_gettime
(
CLOCK_REALTIME
,
&
wait
);
wait
.
tv_nsec
+=
time_ns
;
AssertFatal
((
ret
=
pthread_mutex_timedlock
(
&
slave_proc
->
mutex_FH
,
&
wait
))
==
ETIMEDOUT
,
"ERROR pthread_mutex_lock for RU %d slave %d (IC %d)
\n
"
,
proc
->
ru
->
idx
,
slave_proc
->
ru
->
idx
,
slave_proc
->
instance_cnt_FH
);
if
(
wait
.
tv_nsec
>=
1000
*
1000
*
1000
)
{
wait
.
tv_nsec
-=
1000
*
1000
*
1000
;
wait
.
tv_sec
+=
1
;
}
AssertFatal
((
ret
=
pthread_mutex_timedlock
(
&
slave_proc
->
mutex_FH
,
&
wait
))
==
0
,
"ERROR pthread_mutex_lock for RU %d slave %d (IC %d)
\n
"
,
proc
->
ru
->
idx
,
slave_proc
->
ru
->
idx
,
slave_proc
->
instance_cnt_FH
);
int
cnt_slave
=
++
slave_proc
->
instance_cnt_FH
;
slave_proc
->
frame_rx
=
proc
->
frame_rx
;
...
...
@@ -989,7 +994,12 @@ int wakeup_synch(RU_t *ru) {
// lock the synch mutex and make sure the thread is readif (pthread_mutex_timedlock(&ru->proc.mutex_synch,&wait) != 0) {
clock_gettime
(
CLOCK_REALTIME
,
&
wait
);
wait
.
tv_nsec
+=
time_ns
;
AssertFatal
((
ret
=
pthread_mutex_timedlock
(
&
ru
->
proc
.
mutex_synch
,
&
wait
))
==
ETIMEDOUT
,
"[RU] ERROR pthread_mutex_lock for RU synch thread (IC %d)
\n
"
,
ru
->
proc
.
instance_cnt_synch
);
if
(
wait
.
tv_nsec
>=
1000
*
1000
*
1000
)
{
wait
.
tv_nsec
-=
1000
*
1000
*
1000
;
wait
.
tv_sec
+=
1
;
}
AssertFatal
((
ret
=
pthread_mutex_timedlock
(
&
ru
->
proc
.
mutex_synch
,
&
wait
))
==
0
,
"[RU] ERROR pthread_mutex_lock for RU synch thread (IC %d)
\n
"
,
ru
->
proc
.
instance_cnt_synch
);
++
ru
->
proc
.
instance_cnt_synch
;
...
...
@@ -1189,22 +1199,18 @@ void wakeup_L1s(RU_t *ru) {
}
inline
int
wakeup_prach_ru
(
RU_t
*
ru
)
{
int
ret
;
/*
struct timespec wait;
struct
timespec
wait
;
int
time_ns
=
5000000L
;
clock_gettime
(
CLOCK_REALTIME
,
&
wait
);
wait
.
tv_nsec
+=
time_ns
;
AssertFatal((ret=pthread_mutex_timedlock(&ru->proc.mutex_prach,&wait))==ETIMEDOUT,"[RU] ERROR pthread_mutex_lock for RU prach thread (IC %d)\n", ru->proc.instance_cnt_prach);
*/
struct
timespec
wait
;
wait
.
tv_sec
=
0
;
wait
.
tv_nsec
=
5000000L
;
if
(
pthread_mutex_timedlock
(
&
ru
->
proc
.
mutex_prach
,
&
wait
)
!=
0
)
{
LOG_E
(
PHY
,
"[RU] ERROR pthread_mutex_lock for RU prach thread (IC %d)
\n
"
,
ru
->
proc
.
instance_cnt_prach
);
exit_fun
(
"error locking mutex_rxtx"
);
return
(
-
1
);
if
(
wait
.
tv_nsec
>=
1000
*
1000
*
1000
)
{
wait
.
tv_nsec
-=
1000
*
1000
*
1000
;
wait
.
tv_sec
+=
1
;
}
AssertFatal
((
ret
=
pthread_mutex_timedlock
(
&
ru
->
proc
.
mutex_prach
,
&
wait
))
==
0
,
"[RU] ERROR pthread_mutex_lock for RU prach thread (IC %d)
\n
"
,
ru
->
proc
.
instance_cnt_prach
);
if
(
ru
->
proc
.
instance_cnt_prach
==-
1
)
{
++
ru
->
proc
.
instance_cnt_prach
;
...
...
@@ -1235,7 +1241,12 @@ inline int wakeup_prach_ru_br(RU_t *ru) {
clock_gettime
(
CLOCK_REALTIME
,
&
wait
);
wait
.
tv_nsec
+=
time_ns
;
AssertFatal
((
ret
=
pthread_mutex_timedlock
(
&
ru
->
proc
.
mutex_prach_br
,
&
wait
))
==
ETIMEDOUT
,
"[RU] ERROR pthread_mutex_lock for RU prach thread BR (IC %d)
\n
"
,
ru
->
proc
.
instance_cnt_prach_br
);
if
(
wait
.
tv_nsec
>=
1000
*
1000
*
1000
)
{
wait
.
tv_nsec
-=
1000
*
1000
*
1000
;
wait
.
tv_sec
+=
1
;
}
AssertFatal
((
ret
=
pthread_mutex_timedlock
(
&
ru
->
proc
.
mutex_prach_br
,
&
wait
))
==
0
,
"[RU] ERROR pthread_mutex_lock for RU prach thread BR (IC %d)
\n
"
,
ru
->
proc
.
instance_cnt_prach_br
);
if
(
ru
->
proc
.
instance_cnt_prach_br
==-
1
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment