36 lines
749 B
Zig
36 lines
749 B
Zig
|
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);
|
||
|
// }
|
||
|
// };
|