Add eventflag_wait_all.
This commit is contained in:
@@ -1,3 +1,7 @@
|
|||||||
|
2018-11-09 NIIBE Yutaka <gniibe@fsij.org>
|
||||||
|
|
||||||
|
* eventflag.c (eventflag_wait_all): New.
|
||||||
|
|
||||||
2018-10-02 NIIBE Yutaka <gniibe@fsij.org>
|
2018-10-02 NIIBE Yutaka <gniibe@fsij.org>
|
||||||
|
|
||||||
* VERSION: 1.11.
|
* VERSION: 1.11.
|
||||||
|
|||||||
13
eventflag.c
13
eventflag.c
@@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* eventflag.c - Eventflag
|
* eventflag.c - Eventflag
|
||||||
*
|
*
|
||||||
* Copyright (C) 2013, 2016 Flying Stone Technology
|
* Copyright (C) 2013, 2016, 2018 Flying Stone Technology
|
||||||
* Author: NIIBE Yutaka <gniibe@fsij.org>
|
* Author: NIIBE Yutaka <gniibe@fsij.org>
|
||||||
*
|
*
|
||||||
* This file is a part of Chopstx, a thread library for embedded.
|
* This file is a part of Chopstx, a thread library for embedded.
|
||||||
@@ -107,6 +107,17 @@ eventflag_wait (struct eventflag *ev)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void
|
||||||
|
eventflag_wait_all (struct eventflag *ev, eventmask_t m)
|
||||||
|
{
|
||||||
|
chopstx_mutex_lock (&ev->mutex);
|
||||||
|
while ((ev->flags & m) != m)
|
||||||
|
chopstx_cond_wait (&ev->cond, &ev->mutex);
|
||||||
|
ev->flags &= ~m;
|
||||||
|
chopstx_mutex_unlock (&ev->mutex);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
eventmask_t
|
eventmask_t
|
||||||
eventflag_wait_timeout (struct eventflag *ev, uint32_t usec)
|
eventflag_wait_timeout (struct eventflag *ev, uint32_t usec)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ struct eventflag {
|
|||||||
|
|
||||||
void eventflag_init (struct eventflag *ev);
|
void eventflag_init (struct eventflag *ev);
|
||||||
eventmask_t eventflag_wait (struct eventflag *ev);
|
eventmask_t eventflag_wait (struct eventflag *ev);
|
||||||
|
void eventflag_wait_all (struct eventflag *ev, eventmask_t m);
|
||||||
eventmask_t eventflag_wait_timeout (struct eventflag *ev, uint32_t usec);
|
eventmask_t eventflag_wait_timeout (struct eventflag *ev, uint32_t usec);
|
||||||
void eventflag_signal (struct eventflag *ev, eventmask_t m);
|
void eventflag_signal (struct eventflag *ev, eventmask_t m);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user