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
ef01efc3
Commit
ef01efc3
authored
7 years ago
by
Joakim Nohlgård
Browse files
Options
Downloads
Patches
Plain Diff
core/msg: Set THREAD_FLAG_MSG_WAITING when queueing messages
parent
acfa7271
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
core/msg.c
+12
-0
12 additions, 0 deletions
core/msg.c
with
12 additions
and
0 deletions
core/msg.c
+
12
−
0
View file @
ef01efc3
...
@@ -27,6 +27,9 @@
...
@@ -27,6 +27,9 @@
#include
"msg.h"
#include
"msg.h"
#include
"list.h"
#include
"list.h"
#include
"thread.h"
#include
"thread.h"
#if MODULE_CORE_THREAD_FLAGS
#include
"thread_flags.h"
#endif
#include
"irq.h"
#include
"irq.h"
#include
"cib.h"
#include
"cib.h"
...
@@ -47,6 +50,10 @@ static int queue_msg(thread_t *target, const msg_t *m)
...
@@ -47,6 +50,10 @@ static int queue_msg(thread_t *target, const msg_t *m)
DEBUG
(
"queue_msg(): queuing message
\n
"
);
DEBUG
(
"queue_msg(): queuing message
\n
"
);
msg_t
*
dest
=
&
target
->
msg_array
[
n
];
msg_t
*
dest
=
&
target
->
msg_array
[
n
];
*
dest
=
*
m
;
*
dest
=
*
m
;
#if MODULE_CORE_THREAD_FLAGS
target
->
flags
|=
THREAD_FLAG_MSG_WAITING
;
thread_flags_wake
(
target
);
#endif
return
1
;
return
1
;
}
}
...
@@ -137,6 +144,11 @@ static int _msg_send(msg_t *m, kernel_pid_t target_pid, bool block, unsigned sta
...
@@ -137,6 +144,11 @@ static int _msg_send(msg_t *m, kernel_pid_t target_pid, bool block, unsigned sta
thread_add_to_list
(
&
(
target
->
msg_waiters
),
me
);
thread_add_to_list
(
&
(
target
->
msg_waiters
),
me
);
#if MODULE_CORE_THREAD_FLAGS
target
->
flags
|=
THREAD_FLAG_MSG_WAITING
;
thread_flags_wake
(
target
);
#endif
irq_restore
(
state
);
irq_restore
(
state
);
thread_yield_higher
();
thread_yield_higher
();
...
...
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