Skip to content

Commit

Permalink
Catch Thread's setName.
Browse files Browse the repository at this point in the history
  • Loading branch information
Makosai committed Aug 26, 2024
1 parent 041b273 commit f0a022c
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/Transport/BaseServer.zig
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,9 @@ pub fn start(self: *BaseServer, allocator: std.mem.Allocator) !void {
// have been called before!
{
self.tcp_listener.thread = try std.Thread.spawn(.{}, onTcpConnectCallback, .{ self, allocator });
try self.tcp_listener.thread.?.setName("TcpListener");
self.tcp_listener.thread.?.setName("TcpListener") catch |err| {
print("Error setting thread name: {}\n", .{err});
};
self.tcp_listener.thread.?.detach();
}

Expand Down

0 comments on commit f0a022c

Please sign in to comment.