mirror of
https://github.com/oven-sh/bun
synced 2026-02-11 11:29:02 +00:00
wip fixes to sendfile() blocking
This commit is contained in:
@@ -635,12 +635,8 @@ pub const VirtualMachine = struct {
|
||||
this.tasks.ensureUnusedCapacity(add) catch unreachable;
|
||||
|
||||
{
|
||||
var writable = std.mem.sliceAsBytes(this.tasks.writableSlice(0));
|
||||
const readable = std.mem.sliceAsBytes(this.concurrent_tasks.readableSlice(0));
|
||||
@memcpy(writable.ptr, readable.ptr, @minimum(writable.len, readable.len));
|
||||
this.tasks.count += add;
|
||||
this.concurrent_tasks.head = 0;
|
||||
this.concurrent_tasks.count = 0;
|
||||
this.tasks.writeAssumeCapacity(this.concurrent_tasks.readableSlice(0));
|
||||
this.concurrent_tasks.discard(this.concurrent_tasks.count);
|
||||
}
|
||||
|
||||
_ = this.pending_tasks_count.fetchAdd(add, .Monotonic);
|
||||
|
||||
Reference in New Issue
Block a user