authorgravatar for vincent@rischmann.frVincent Rischmann <vincent@rischmann.fr> 2021-04-26 18:03:32+02:00
committergravatar for noreply@github.comGitHub <noreply@github.com> 2021-04-26 18:03:32+02:00
log77cb45f59f7b37c316af1762298d6032e2b130b5
treead6bc515f8249b63f96de3fe57e1bf79000a3e3f
parentbf67a3fdc9efea7126058b21e687c24868bc1268
signaturebadge-question-mark Signed by PGP key 4AEE18F83AFDEB23

thread: simplify and remove useless return in spawn (#8621)


1 files changed, 5 insertions(+), 7 deletions(-)

lib/std/Thread.zig+5-7
...@@ -360,15 +360,13 @@ pub fn spawn(comptime startFn: anytype, context: SpawnContextType(@TypeOf(startF...@@ -360,15 +360,13 @@ pub fn spawn(comptime startFn: anytype, context: SpawnContextType(@TypeOf(startF
360 MainFuncs.posixThreadMain,360 MainFuncs.posixThreadMain,
361 thread_obj.data.memory.ptr,361 thread_obj.data.memory.ptr,
362 );362 );
363 switch (err) {363 return switch (err) {
364 0 => return thread_obj,364 0 => thread_obj,
365 os.EAGAIN => return error.SystemResources,365 os.EAGAIN => error.SystemResources,
366 os.EPERM => unreachable,366 os.EPERM => unreachable,
367 os.EINVAL => unreachable,367 os.EINVAL => unreachable,
368 else => return os.unexpectedErrno(err),368 else => os.unexpectedErrno(err),
369 }369 };
370
371 return thread_obj;
372 }370 }
373371
374 var guard_end_offset: usize = undefined;372 var guard_end_offset: usize = undefined;