File tree 1 file changed +4
-0
lines changed
1 file changed +4
-0
lines changed Original file line number Diff line number Diff line change 1
1
const std = @import ("std" );
2
+ const log = std .log .scoped (.scheduler );
2
3
3
4
const Priority = enum (u8 ) {
4
5
high = 0 ,
@@ -109,6 +110,7 @@ fn getTaskToRun(self: *Self) ?*Queue.Node {
109
110
defer self .queue_mutex .unlock ();
110
111
111
112
while (! self .stopping ) {
113
+ log .info ("thread {} is looking for work" , .{std .Thread .getCurrentId ()});
112
114
const task = self .queue .popFirst () orelse {
113
115
self .queue_not_empty .timedWait (& self .queue_mutex , std .time .us_per_min ) catch {};
114
116
continue ;
@@ -157,6 +159,8 @@ pub fn start(self: *Self, thread_count: usize) !void {
157
159
const thread = try std .Thread .spawn (.{}, workerThreadFunc , .{self });
158
160
self .threads .appendAssumeCapacity (thread );
159
161
}
162
+
163
+ log .info ("started {} worker threads" , .{thread_count });
160
164
}
161
165
162
166
pub fn stop (self : * Self ) void {
You can’t perform that action at this time.
0 commit comments