| ... | @@ -687,9 +687,14 @@ pub const Loop = struct { | ... | @@ -687,9 +687,14 @@ pub const Loop = struct { |
| 687 | | 687 | |
| 688 | switch (builtin.os.tag) { | 688 | switch (builtin.os.tag) { |
| 689 | .linux => { | 689 | .linux => { |
| 690 | // writing 8 bytes to an eventfd cannot fail | 690 | // writing to the eventfd will only wake up one thread, thus multiple writes |
| 691 | const amt = os.write(self.os_data.final_eventfd, &wakeup_bytes) catch unreachable; | 691 | // are needed to wakeup all the threads |
| 692 | assert(amt == wakeup_bytes.len); | 692 | var i: usize = 0; |
| | 693 | while (i < self.extra_threads.len + 1) : (i += 1) { |
| | 694 | // writing 8 bytes to an eventfd cannot fail |
| | 695 | const amt = os.write(self.os_data.final_eventfd, &wakeup_bytes) catch unreachable; |
| | 696 | assert(amt == wakeup_bytes.len); |
| | 697 | } |
| 693 | return; | 698 | return; |
| 694 | }, | 699 | }, |
| 695 | .macosx, .freebsd, .netbsd, .dragonfly => { | 700 | .macosx, .freebsd, .netbsd, .dragonfly => { |