Skip to content

Commit 3dd728a

Browse files
committed
ensure that the v2 bundler uses the WorkPool's threadpool
1 parent a57cf47 commit 3dd728a

File tree

1 file changed

+1
-13
lines changed

1 file changed

+1
-13
lines changed

Diff for: src/bundler/bundle_v2.zig

+1-13
Original file line numberDiff line numberDiff line change
@@ -153,20 +153,8 @@ pub const ThreadPool = struct {
153153

154154
pub fn start(this: *ThreadPool, v2: *BundleV2, existing_thread_pool: ?*ThreadPoolLib) !void {
155155
this.v2 = v2;
156-
157-
if (existing_thread_pool) |pool| {
158-
this.pool = pool;
159-
} else {
160-
const cpu_count = bun.getThreadCount();
161-
this.pool = try v2.graph.allocator.create(ThreadPoolLib);
162-
this.pool.* = ThreadPoolLib.init(.{
163-
.max_threads = cpu_count,
164-
});
165-
debug("{d} workers", .{cpu_count});
166-
}
167-
156+
this.pool = existing_thread_pool orelse JSC.WorkPool.get();
168157
this.pool.warm(8);
169-
170158
this.pool.setThreadContext(this);
171159
}
172160

0 commit comments

Comments
 (0)