commit b2f8631a3c9b2cc04a4c78f38d164130be2fb1ae (tree)
parent 32fd637e57c3b4391b3f2f4499c803e3d4e8f615
Author: Andrew Kelley <andrew@ziglang.org>
Date: Fri, 18 Dec 2020 21:50:44 -0700
ThreadPool: delete dead code
If this errdefer did get run it would constitute a race condition. So I
deleted the dead code for clarity.
Diffstat:
2 files changed, 0 insertions(+), 1 deletion(-)
diff --git a/lib/std/progress.zig b/lib/std/Progress.zig
diff --git a/src/ThreadPool.zig b/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,