Skip to content

Commit 8557570

Browse files
shriteshandrewrk
authored andcommitted
Use linux.exit_group if not single threaded
1 parent 5942797 commit 8557570

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

std/os.zig

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,14 @@ pub fn exit(status: u8) noreturn {
213213
c.exit(status);
214214
}
215215
switch (builtin.os) {
216-
Os.linux, Os.macosx, Os.ios, Os.freebsd, Os.netbsd => {
216+
Os.linux => {
217+
if (builtin.single_threaded) {
218+
linux.exit(status);
219+
} else {
220+
linux.exit_group(status);
221+
}
222+
},
223+
Os.macosx, Os.ios, Os.freebsd, Os.netbsd => {
217224
posix.exit(status);
218225
},
219226
Os.windows => {

0 commit comments

Comments
 (0)