Commit b2f8631a3c

Andrew Kelley <andrew@ziglang.org>
2020-12-19 05:50:44
ThreadPool: delete dead code
If this errdefer did get run it would constitute a race condition. So I deleted the dead code for clarity.
1 parent 32fd637
Changed files (2)
lib/std/progress.zig → lib/std/Progress.zig
File renamed without changes
src/ThreadPool.zig
@@ -77,7 +77,6 @@ pub fn spawn(self: *ThreadPool, comptime func: anytype, args: anytype) !void {
     };
 
     const closure = try self.allocator.create(Closure);
-    errdefer self.allocator.destroy(closure);
     closure.* = .{
         .arguments = args,
         .pool = self,