mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2025-05-01 13:14:02 +00:00
This simple event implemention can only support exclusive waiting at same time. It mainly used by thread who want to wait for special event happens. Thread A who want to wait for some events calls wait_event(struct sched_event *); Thread B who can give the event signal calls signal_event(struct sched_event *); Tracked-On: #4329 Signed-off-by: Shuo A Liu <shuo.a.liu@intel.com> Acked-by: Eddie Dong <eddie.dong@intel.com>
17 lines
349 B
C
17 lines
349 B
C
#ifndef EVENT_H
|
|
#define EVENT_H
|
|
#include <spinlock.h>
|
|
|
|
struct sched_event {
|
|
spinlock_t lock;
|
|
bool set;
|
|
struct thread_object* waiting_thread;
|
|
};
|
|
|
|
void init_event(struct sched_event *event);
|
|
void reset_event(struct sched_event *event);
|
|
void wait_event(struct sched_event *event);
|
|
void signal_event(struct sched_event *event);
|
|
|
|
#endif /* EVENT_H */
|