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
46888a1e
Commit
46888a1e
authored
6 years ago
by
Hauke Petersen
Browse files
Options
Downloads
Patches
Plain Diff
sys/event: allow calling event_post multiple times
parent
f29714ea
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
sys/event/event.c
+4
-3
4 additions, 3 deletions
sys/event/event.c
sys/include/event.h
+5
-0
5 additions, 0 deletions
sys/include/event.h
with
9 additions
and
3 deletions
sys/event/event.c
+
4
−
3
View file @
46888a1e
...
...
@@ -23,11 +23,12 @@ void event_queue_init(event_queue_t *queue)
void
event_post
(
event_queue_t
*
queue
,
event_t
*
event
)
{
assert
(
!
event
->
list_node
.
next
);
assert
(
queue
->
waiter
);
assert
(
queue
&&
queue
->
waiter
&&
event
);
unsigned
state
=
irq_disable
();
clist_rpush
(
&
queue
->
event_list
,
&
event
->
list_node
);
if
(
!
event
->
list_node
.
next
)
{
clist_rpush
(
&
queue
->
event_list
,
&
event
->
list_node
);
}
irq_restore
(
state
);
thread_flags_set
(
queue
->
waiter
,
THREAD_FLAG_EVENT
);
...
...
This diff is collapsed.
Click to expand it.
sys/include/event.h
+
5
−
0
View file @
46888a1e
...
...
@@ -149,6 +149,11 @@ void event_queue_init(event_queue_t *queue);
/**
* @brief Queue an event
*
* The given event will be posted on the given @p queue. If the event is already
* queued when calling this function, the event will not be touched and remain
* in the previous position on the queue. So reposting an event while it is
* already on the queue will have no effect.
*
* @param[in] queue event queue to queue event in
* @param[in] event event to queue in event queue
*/
...
...
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