Skip to content

Commit

Permalink
Fix type signatures in Scheduler
Browse files Browse the repository at this point in the history
  • Loading branch information
lalinsky committed Dec 6, 2024
1 parent 67793e8 commit 53e6a8b
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/utils/Scheduler.zig
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ pub fn deinit(self: *Self) void {
std.debug.assert(self.num_tasks == 0);
}

pub fn createTask(self: *Self, priority: Priority, func: anytype, ctx: anytype) !*Queue.Node {
pub fn createTask(self: *Self, priority: Priority, func: anytype, ctx: anytype) !Task {
self.queue_mutex.lock();
defer self.queue_mutex.unlock();

Expand All @@ -71,7 +71,7 @@ pub fn createTask(self: *Self, priority: Priority, func: anytype, ctx: anytype)
return task;
}

pub fn destroyTask(self: *Self, task: *Queue.Node) void {
pub fn destroyTask(self: *Self, task: Task) void {
self.queue_mutex.lock();
if (task.data.scheduled) {
self.queue.remove(task);
Expand All @@ -86,7 +86,7 @@ pub fn destroyTask(self: *Self, task: *Queue.Node) void {
self.num_tasks -= 1;
}

pub fn scheduleTask(self: *Self, task: *Queue.Node) void {
pub fn scheduleTask(self: *Self, task: Task) void {
self.queue_mutex.lock();
defer self.queue_mutex.unlock();

Expand All @@ -98,7 +98,7 @@ pub fn scheduleTask(self: *Self, task: *Queue.Node) void {
self.addToQueue(task);
}

pub fn addToQueue(self: *Self, task: *Queue.Node) void {
fn addToQueue(self: *Self, task: *Queue.Node) void {
task.data.scheduled = true;
self.queue.prepend(task);
self.queue_not_empty.signal();
Expand Down

0 comments on commit 53e6a8b

Please sign in to comment.