mirror of
https://github.com/lightpanda-io/browser.git
synced 2025-10-29 15:13:28 +00:00
reject long timeouts as we're shutting down
This commit is contained in:
@@ -193,6 +193,11 @@ pub const Loop = struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
pub fn timeout(self: *Self, nanoseconds: u63, callback_node: ?*CallbackNode) !usize {
|
pub fn timeout(self: *Self, nanoseconds: u63, callback_node: ?*CallbackNode) !usize {
|
||||||
|
if (self.stopping and nanoseconds > std.time.ns_per_ms * 500) {
|
||||||
|
// we're trying to shutdown, we probably don't want to wait for a new
|
||||||
|
// long timeout
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
const completion = try self.alloc.create(Completion);
|
const completion = try self.alloc.create(Completion);
|
||||||
errdefer self.alloc.destroy(completion);
|
errdefer self.alloc.destroy(completion);
|
||||||
completion.* = undefined;
|
completion.* = undefined;
|
||||||
|
|||||||
Reference in New Issue
Block a user