flipperzero-zig/lib/flipperzero/thread.zig

36 lines
749 B
Zig
Raw Normal View History

2024-08-22 02:27:21 +00:00
const flipperzero = @import("flipperzero.zig");
const c = flipperzero.c;
pub const FuriMutex = struct {
const Self = @This();
pub fn create(type_: c.FuriMutexType) *Self {
return @ptrCast(c.furi_mutex_alloc(type_));
}
pub fn destroy(self: *Self) void {
c.furi_mutex_free(self);
}
};
// pub const FuriThread = struct {
// data: *anyopaque,
// const Self = @This();
// pub fn create() Self {
// return Self{
// .data = c.furi_thread_alloc()
// };
// }
// pub fn join(self: Self) void {
// c.furi_thread_join(self.data);
// }
// pub fn destroy(self: Self) void {
// self.join();
// c.furi_thread_free(self.data);
// }
// };