Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
R
RIOT
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
cm-projects
RIOT
Commits
986b9d38
Commit
986b9d38
authored
6 years ago
by
Martine Lenders
Committed by
Martine Lenders
6 years ago
Browse files
Options
Downloads
Patches
Plain Diff
gnrc_netreg: make message queue check more readable
parent
c8937f8d
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
sys/net/gnrc/netreg/gnrc_netreg.c
+8
-7
8 additions, 7 deletions
sys/net/gnrc/netreg/gnrc_netreg.c
with
8 additions
and
7 deletions
sys/net/gnrc/netreg/gnrc_netreg.c
+
8
−
7
View file @
986b9d38
...
@@ -39,13 +39,14 @@ void gnrc_netreg_init(void)
...
@@ -39,13 +39,14 @@ void gnrc_netreg_init(void)
int
gnrc_netreg_register
(
gnrc_nettype_t
type
,
gnrc_netreg_entry_t
*
entry
)
int
gnrc_netreg_register
(
gnrc_nettype_t
type
,
gnrc_netreg_entry_t
*
entry
)
{
{
#ifdef DEVELHELP
#if DEVELHELP
#if defined(MODULE_GNRC_NETAPI_MBOX) || defined(MODULE_GNRC_NETAPI_CALLBACKS)
# if defined(MODULE_GNRC_NETAPI_MBOX) || defined(MODULE_GNRC_NETAPI_CALLBACKS)
bool
has_msg_q
=
(
entry
->
type
!=
GNRC_NETREG_TYPE_DEFAULT
)
||
bool
has_msg_q
=
(
entry
->
type
!=
GNRC_NETREG_TYPE_DEFAULT
)
||
sched_threads
[
entry
->
target
.
pid
]
->
msg_array
;
(
sched_threads
[
entry
->
target
.
pid
]
->
msg_array
!=
NULL
)
;
#else
#
else
bool
has_msg_q
=
sched_threads
[
entry
->
target
.
pid
]
->
msg_array
;
bool
has_msg_q
=
(
sched_threads
[
entry
->
target
.
pid
]
->
msg_array
!=
NULL
)
;
#endif
#
endif
/* only threads with a message queue are allowed to register at gnrc */
/* only threads with a message queue are allowed to register at gnrc */
if
(
!
has_msg_q
)
{
if
(
!
has_msg_q
)
{
...
@@ -53,7 +54,7 @@ int gnrc_netreg_register(gnrc_nettype_t type, gnrc_netreg_entry_t *entry)
...
@@ -53,7 +54,7 @@ int gnrc_netreg_register(gnrc_nettype_t type, gnrc_netreg_entry_t *entry)
"using msg_init_queue() !!!!
\n\n
"
,
entry
->
target
.
pid
);
"using msg_init_queue() !!!!
\n\n
"
,
entry
->
target
.
pid
);
}
}
assert
(
has_msg_q
);
assert
(
has_msg_q
);
#endif
#endif
/* DEVELHELP */
if
(
_INVALID_TYPE
(
type
))
{
if
(
_INVALID_TYPE
(
type
))
{
return
-
EINVAL
;
return
-
EINVAL
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment