jobqueue prepend alloc fix

This commit is contained in:
Muaz Ahmad 2023-11-27 15:41:43 +05:00
parent 3e20d948f8
commit 2fd354bd25

View file

@ -33,10 +33,10 @@ pub const JobQueue = struct {
}; };
} }
pub fn prepend(self: *Self, job: Job) void { pub fn prepend(self: *Self, job: Job) !void {
self.mutex.lock(); self.mutex.lock();
defer self.mutex.unlock(); defer self.mutex.unlock();
var n = try self.job_pool.create(Node); var n = try self.job_pool.create();
n.data = job; n.data = job;
return self.queue.prepend(n); return self.queue.prepend(n);
} }