mirror of
https://github.com/ziglang/zig.git
synced 2026-02-13 12:59:04 +00:00
Remove obsolete runtime panics from sleep impl
This commit is contained in:
parent
5186711a96
commit
f26ab568aa
@ -40,16 +40,8 @@ pub fn sleep(nanoseconds: u64) void {
|
||||
|
||||
var event: w.event_t = undefined;
|
||||
var nevents: usize = undefined;
|
||||
switch (w.poll_oneoff(&in, &event, 1, &nevents)) {
|
||||
w.ESUCCESS => {},
|
||||
else => |err| @panic("unexpected error of poll_oneoff"),
|
||||
}
|
||||
|
||||
if (nevents == 1 and event.userdata == userdata and event.@"error" == w.ESUCCESS and event.@"type" == w.EVENTTYPE_CLOCK) {
|
||||
return;
|
||||
}
|
||||
|
||||
@panic("unexpected result of poll_oneoff");
|
||||
_ = w.poll_oneoff(&in, &event, 1, &nevents);
|
||||
return;
|
||||
}
|
||||
|
||||
const s = nanoseconds / ns_per_s;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user