pub fn takeIpcIndex(node: Node) ?Ipc.Index node: Node461
462
463
464
465
466
467
468
469
470 pub fn takeIpcIndex(node: Node) ?Ipc.Index {
const storage = storageByIndex(node.index.unwrap() orelse return null);
switch (storage.estimated_total_count) {
std.math.maxInt(u32) => {}, // indicates that there is an IPC index in `completed_count`
0 => return null, // `setIpcFile` failed so we don't have an IPC index for this node
else => unreachable, // not an IPC node
}
@atomicStore(u32, &storage.estimated_total_count, 0, .monotonic);
return @bitCast(storage.completed_count);
}
Not thread-safe.