Skip to content

Commit c5efe3e

Browse files
committed
More logging
1 parent 52a158e commit c5efe3e

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/utils/Scheduler.zig

+4
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
const std = @import("std");
2+
const log = std.log.scoped(.scheduler);
23

34
const Priority = enum(u8) {
45
high = 0,
@@ -109,6 +110,7 @@ fn getTaskToRun(self: *Self) ?*Queue.Node {
109110
defer self.queue_mutex.unlock();
110111

111112
while (!self.stopping) {
113+
log.info("thread {} is looking for work", .{std.Thread.getCurrentId()});
112114
const task = self.queue.popFirst() orelse {
113115
self.queue_not_empty.timedWait(&self.queue_mutex, std.time.us_per_min) catch {};
114116
continue;
@@ -157,6 +159,8 @@ pub fn start(self: *Self, thread_count: usize) !void {
157159
const thread = try std.Thread.spawn(.{}, workerThreadFunc, .{self});
158160
self.threads.appendAssumeCapacity(thread);
159161
}
162+
163+
log.info("started {} worker threads", .{thread_count});
160164
}
161165

162166
pub fn stop(self: *Self) void {

0 commit comments

Comments
 (0)