aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHimbeer <himbeer@disroot.org>2024-08-01 18:08:18 +0200
committerHimbeer <himbeer@disroot.org>2024-08-01 18:08:18 +0200
commit191edb1dd53552c46959a8ab2f3155dfbaef6d11 (patch)
tree6cdebe54b1411cc80346c0228f969a21fb716b3f
parent8bede94e7c41fb89f51950343f17e7d8372405ec (diff)
process: Remove unused allowResume method
-rw-r--r--src/channel.zig5
-rw-r--r--src/process.zig5
2 files changed, 3 insertions, 7 deletions
diff --git a/src/channel.zig b/src/channel.zig
index 7687afa..6367463 100644
--- a/src/channel.zig
+++ b/src/channel.zig
@@ -13,6 +13,7 @@ pub const Error = error{
pub const Message = struct {
bytes: []const u8,
refcount: usize = 1,
+ process_filter: u16,
fn addReference(self: *Message) !void {
self.refcount = try std.math.add(usize, self.refcount, 1);
@@ -55,11 +56,11 @@ pub fn leave(pid: usize, id: usize) void {
}
// The channel takes ownership of `bytes`.
-pub fn pass(id: usize, bytes: []const u8) !void {
+pub fn pass(id: usize, receiver: u16, bytes: []const u8) !void {
const message = try alloc.create(Message);
defer message.dropReference();
- message.* = .{ .bytes = bytes };
+ message.* = .{ .bytes = bytes, .process_filter = receiver };
var it = joined.iterator();
while (it.next()) |queues| {
diff --git a/src/process.zig b/src/process.zig
index e9daa07..1b1486b 100644
--- a/src/process.zig
+++ b/src/process.zig
@@ -127,11 +127,6 @@ pub const Info = struct {
}
}
- pub fn allowResume(self: *Info) void {
- self.pc += 4; // Skip ecall instruction
- self.state = .waiting;
- }
-
pub fn shouldTerminate(self: *const Info, candidate: *const Info) bool {
return candidate.id == self.id and self.shouldTerminateThread(candidate);
}