Move accept loop to common runtime

This commit is contained in:
Nikolay Govorov
2026-03-05 00:16:35 +00:00
parent 8e59ce9e9f
commit 687f577562
7 changed files with 160 additions and 106 deletions

View File

@@ -39,7 +39,6 @@ telemetry: Telemetry,
allocator: Allocator,
arena_pool: ArenaPool,
app_dir_path: ?[]const u8,
shutdown: bool = false,
pub fn init(allocator: Allocator, config: *const Config) !*App {
const app = try allocator.create(App);
@@ -76,11 +75,11 @@ pub fn init(allocator: Allocator, config: *const Config) !*App {
return app;
}
pub fn deinit(self: *App) void {
if (@atomicRmw(bool, &self.shutdown, .Xchg, true, .monotonic)) {
return;
}
pub fn shutdown(self: *const App) bool {
return self.network.shutdown.load(.acquire);
}
pub fn deinit(self: *App) void {
const allocator = self.allocator;
if (self.app_dir_path) |app_dir_path| {
allocator.free(app_dir_path);