mirror of
https://github.com/ziglang/zig.git
synced 2024-11-16 09:03:12 +00:00
thread: simplify and remove useless return in spawn (#8621)
This commit is contained in:
parent
bf67a3fdc9
commit
77cb45f59f
@ -360,15 +360,13 @@ pub fn spawn(comptime startFn: anytype, context: SpawnContextType(@TypeOf(startF
|
||||
MainFuncs.posixThreadMain,
|
||||
thread_obj.data.memory.ptr,
|
||||
);
|
||||
switch (err) {
|
||||
0 => return thread_obj,
|
||||
os.EAGAIN => return error.SystemResources,
|
||||
return switch (err) {
|
||||
0 => thread_obj,
|
||||
os.EAGAIN => error.SystemResources,
|
||||
os.EPERM => unreachable,
|
||||
os.EINVAL => unreachable,
|
||||
else => return os.unexpectedErrno(err),
|
||||
}
|
||||
|
||||
return thread_obj;
|
||||
else => os.unexpectedErrno(err),
|
||||
};
|
||||
}
|
||||
|
||||
var guard_end_offset: usize = undefined;
|
||||
|
Loading…
Reference in New Issue
Block a user