mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-07-14 15:56:13 +03:00
pkg/libuv: get rid of sleep state, it did nothing
This commit is contained in:
@ -23,7 +23,6 @@ mutex: Mutex,
|
||||
cond: Cond,
|
||||
ready: bool = false,
|
||||
terminate: BoolAtomic,
|
||||
sleeping: BoolAtomic,
|
||||
callback: std.meta.FnPtr(fn () void),
|
||||
thread: ?Thread,
|
||||
|
||||
@ -39,7 +38,6 @@ pub fn init(
|
||||
.mutex = try Mutex.init(alloc),
|
||||
.cond = try Cond.init(alloc),
|
||||
.terminate = BoolAtomic.init(false),
|
||||
.sleeping = BoolAtomic.init(false),
|
||||
.callback = callback,
|
||||
.thread = null,
|
||||
};
|
||||
@ -97,18 +95,6 @@ fn threadMain(self: *Embed) void {
|
||||
const fd = self.loop.backendFd() catch unreachable;
|
||||
const timeout = self.loop.backendTimeout();
|
||||
|
||||
// If the timeout is negative then we are sleeping (i.e. no
|
||||
// timers active or anything). In that case, we set the boolean
|
||||
// to true so that we can wake up the event loop if we have to.
|
||||
if (timeout < 0) {
|
||||
log.debug("going to sleep", .{});
|
||||
self.sleeping.store(true, .SeqCst);
|
||||
}
|
||||
defer if (timeout < 0) {
|
||||
log.debug("waking from sleep", .{});
|
||||
self.sleeping.store(false, .SeqCst);
|
||||
};
|
||||
|
||||
switch (builtin.os.tag) {
|
||||
// epoll
|
||||
.linux => {
|
||||
|
Reference in New Issue
Block a user