ke: add reset to event

This commit is contained in:
Loïc Grégoire
2026-06-17 19:57:35 -04:00
parent ead1f5b324
commit 797018f86e
+9 -2
View File
@@ -8,9 +8,9 @@ pub const Event = struct {
const Self = @This(); const Self = @This();
pub const Type = enum { pub const Type = enum {
/// Wake only one waiter. /// Wake only one waiter and decrease signaled.
Synchronization, Synchronization,
/// Wake all waiters. /// Wake all waiters a keep signaled high.
Notification, Notification,
}; };
@@ -29,4 +29,11 @@ pub const Event = struct {
ki.wait.satisfy_wait(&self.hdr); ki.wait.satisfy_wait(&self.hdr);
self.hdr.lock.release(ipl); self.hdr.lock.release(ipl);
} }
/// Reset an event.
pub fn reset(self: *Self) void {
const ipl = self.hdr.lock.acquire();
self.hdr.signaled = 0;
self.hdr.lock.release(ipl);
}
}; };