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,
|
cond: Cond,
|
||||||
ready: bool = false,
|
ready: bool = false,
|
||||||
terminate: BoolAtomic,
|
terminate: BoolAtomic,
|
||||||
sleeping: BoolAtomic,
|
|
||||||
callback: std.meta.FnPtr(fn () void),
|
callback: std.meta.FnPtr(fn () void),
|
||||||
thread: ?Thread,
|
thread: ?Thread,
|
||||||
|
|
||||||
@ -39,7 +38,6 @@ pub fn init(
|
|||||||
.mutex = try Mutex.init(alloc),
|
.mutex = try Mutex.init(alloc),
|
||||||
.cond = try Cond.init(alloc),
|
.cond = try Cond.init(alloc),
|
||||||
.terminate = BoolAtomic.init(false),
|
.terminate = BoolAtomic.init(false),
|
||||||
.sleeping = BoolAtomic.init(false),
|
|
||||||
.callback = callback,
|
.callback = callback,
|
||||||
.thread = null,
|
.thread = null,
|
||||||
};
|
};
|
||||||
@ -97,18 +95,6 @@ fn threadMain(self: *Embed) void {
|
|||||||
const fd = self.loop.backendFd() catch unreachable;
|
const fd = self.loop.backendFd() catch unreachable;
|
||||||
const timeout = self.loop.backendTimeout();
|
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) {
|
switch (builtin.os.tag) {
|
||||||
// epoll
|
// epoll
|
||||||
.linux => {
|
.linux => {
|
||||||
|
Reference in New Issue
Block a user