mirror of
https://github.com/rdmsr/zag.git
synced 2026-11-01 23:58:21 +00:00
ps+ke: add thread reaping
This commit is contained in:
@@ -150,8 +150,7 @@ fn particle(param: ?*anyopaque) void {
|
||||
data.vel_y += @divTrunc(int_to_fp(10) * delay, 1000);
|
||||
}
|
||||
|
||||
// Now block.
|
||||
ke.sched.block();
|
||||
ps.thread.exit();
|
||||
}
|
||||
|
||||
fn spawn_particle(arg: ?*anyopaque) void {
|
||||
@@ -214,7 +213,7 @@ fn explodeable(_: ?*anyopaque) void {
|
||||
spawn_particle(param);
|
||||
}
|
||||
|
||||
ke.sched.block();
|
||||
ps.thread.exit();
|
||||
}
|
||||
|
||||
pub fn start(param: ?*anyopaque) void {
|
||||
@@ -239,6 +238,8 @@ pub fn start(param: ?*anyopaque) void {
|
||||
spawn_explodeable();
|
||||
}
|
||||
|
||||
std.log.info("async: {}, sync: {}, usable memory: {} KiB", .{ mm.private.tlb.async_shootdowns.load(.monotonic), mm.private.tlb.sync_shootdowns.load(.monotonic), mm.private.phys.usable_memory.load(.monotonic) / 1024 });
|
||||
|
||||
perform_delay(2000);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user