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
alex037yang
OpenXG-RAN
Commits
eb2dfa1b
Commit
eb2dfa1b
authored
Dec 12, 2017
by
Robert Schmidt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
kill_eNB_proc(): join all PHY threads
parent
c619f6ef
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
41 additions
and
2 deletions
+41
-2
targets/RT/USER/lte-enb.c
targets/RT/USER/lte-enb.c
+41
-2
No files found.
targets/RT/USER/lte-enb.c
View file @
eb2dfa1b
...
@@ -1754,6 +1754,7 @@ void init_eNB_proc(int inst) {
...
@@ -1754,6 +1754,7 @@ void init_eNB_proc(int inst) {
pthread_mutex_init
(
&
proc
->
mutex_prach
,
NULL
);
pthread_mutex_init
(
&
proc
->
mutex_prach
,
NULL
);
pthread_mutex_init
(
&
proc
->
mutex_asynch_rxtx
,
NULL
);
pthread_mutex_init
(
&
proc
->
mutex_asynch_rxtx
,
NULL
);
pthread_mutex_init
(
&
proc
->
mutex_synch
,
NULL
);
pthread_mutex_init
(
&
proc
->
mutex_synch
,
NULL
);
pthread_mutex_init
(
&
proc
->
mutex_FH
,
NULL
);
pthread_cond_init
(
&
proc
->
cond_prach
,
NULL
);
pthread_cond_init
(
&
proc
->
cond_prach
,
NULL
);
pthread_cond_init
(
&
proc
->
cond_FH
,
NULL
);
pthread_cond_init
(
&
proc
->
cond_FH
,
NULL
);
...
@@ -1862,30 +1863,68 @@ void kill_eNB_proc(int inst) {
...
@@ -1862,30 +1863,68 @@ void kill_eNB_proc(int inst) {
printf
(
"Killing TX CC_id %d thread %d
\n
"
,
CC_id
,
i
);
printf
(
"Killing TX CC_id %d thread %d
\n
"
,
CC_id
,
i
);
#endif
#endif
proc_rxtx
[
0
].
instance_cnt_rxtx
=
0
;
// FIXME data race!
pthread_mutex_lock
(
&
proc_rxtx
[
0
].
mutex_rxtx
);
proc_rxtx
[
1
].
instance_cnt_rxtx
=
0
;
// FIXME data race!
proc_rxtx
[
0
].
instance_cnt_rxtx
=
0
;
pthread_mutex_unlock
(
&
proc_rxtx
[
0
].
mutex_rxtx
);
pthread_mutex_lock
(
&
proc_rxtx
[
1
].
mutex_rxtx
);
proc_rxtx
[
1
].
instance_cnt_rxtx
=
0
;
pthread_mutex_unlock
(
&
proc_rxtx
[
1
].
mutex_rxtx
);
pthread_mutex_lock
(
&
PHY_vars_eNB_g
[
0
][
CC_id
]
->
proc
.
mutex_synch
);
PHY_vars_eNB_g
[
0
][
CC_id
]
->
proc
.
instance_cnt_synch
=
1
;
pthread_mutex_unlock
(
&
PHY_vars_eNB_g
[
0
][
CC_id
]
->
proc
.
mutex_synch
);
proc
->
instance_cnt_prach
=
0
;
proc
->
instance_cnt_prach
=
0
;
proc
->
instance_cnt_FH
=
0
;
proc
->
instance_cnt_FH
=
0
;
pthread_cond_signal
(
&
proc_rxtx
[
0
].
cond_rxtx
);
pthread_cond_signal
(
&
proc_rxtx
[
0
].
cond_rxtx
);
pthread_cond_signal
(
&
proc_rxtx
[
1
].
cond_rxtx
);
pthread_cond_signal
(
&
proc_rxtx
[
1
].
cond_rxtx
);
pthread_cond_signal
(
&
proc
->
cond_prach
);
pthread_cond_signal
(
&
proc
->
cond_prach
);
pthread_cond_signal
(
&
proc
->
cond_FH
);
pthread_cond_signal
(
&
proc
->
cond_FH
);
pthread_cond_signal
(
&
proc
->
cond_asynch_rxtx
);
pthread_cond_signal
(
&
proc
->
cond_synch
);
pthread_cond_broadcast
(
&
sync_phy_proc
.
cond_phy_proc_tx
);
pthread_cond_broadcast
(
&
sync_phy_proc
.
cond_phy_proc_tx
);
#ifdef DEBUG_THREADS
printf
(
"joining pthread_FH
\n
"
);
#endif
pthread_join
(
proc
->
pthread_FH
,
(
void
**
)
&
status
);
pthread_join
(
proc
->
pthread_FH
,
(
void
**
)
&
status
);
pthread_mutex_destroy
(
&
proc
->
mutex_FH
);
pthread_mutex_destroy
(
&
proc
->
mutex_FH
);
pthread_cond_destroy
(
&
proc
->
cond_FH
);
pthread_cond_destroy
(
&
proc
->
cond_FH
);
#ifdef DEBUG_THREADS
printf
(
"joining pthread_prach
\n
"
);
#endif
pthread_join
(
proc
->
pthread_prach
,
(
void
**
)
&
status
);
pthread_join
(
proc
->
pthread_prach
,
(
void
**
)
&
status
);
pthread_mutex_destroy
(
&
proc
->
mutex_prach
);
pthread_mutex_destroy
(
&
proc
->
mutex_prach
);
pthread_cond_destroy
(
&
proc
->
cond_prach
);
pthread_cond_destroy
(
&
proc
->
cond_prach
);
int
i
;
int
i
;
for
(
i
=
0
;
i
<
2
;
i
++
)
{
for
(
i
=
0
;
i
<
2
;
i
++
)
{
#ifdef DEBUG_THREADS
printf
(
"joining pthread_rxtx
\n
"
);
#endif
pthread_join
(
proc_rxtx
[
i
].
pthread_rxtx
,
(
void
**
)
&
status
);
pthread_join
(
proc_rxtx
[
i
].
pthread_rxtx
,
(
void
**
)
&
status
);
pthread_mutex_destroy
(
&
proc_rxtx
[
i
].
mutex_rxtx
);
pthread_mutex_destroy
(
&
proc_rxtx
[
i
].
mutex_rxtx
);
pthread_cond_destroy
(
&
proc_rxtx
[
i
].
cond_rxtx
);
pthread_cond_destroy
(
&
proc_rxtx
[
i
].
cond_rxtx
);
}
}
#ifdef DEBUG_THREADS
printf
(
"joining pthread_asynch_rxtx
\n
"
);
#endif
pthread_join
(
proc
->
pthread_asynch_rxtx
,
(
void
**
)
&
status
);
pthread_mutex_destroy
(
&
proc
->
mutex_asynch_rxtx
);
pthread_cond_destroy
(
&
proc
->
cond_asynch_rxtx
);
#ifdef DEBUG_THREADS
printf
(
"joining pthread_single
\n
"
);
#endif
pthread_join
(
proc
->
pthread_single
,
(
void
**
)
&
status
);
#ifdef DEBUG_THREADS
printf
(
"joining pthread_synch
\n
"
);
#endif
pthread_join
(
proc
->
pthread_synch
,
(
void
**
)
&
status
);
pthread_mutex_destroy
(
&
proc
->
mutex_synch
);
pthread_cond_destroy
(
&
proc
->
cond_synch
);
printf
(
"joined all threads
\n
"
);
}
}
}
}
...
...
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