Merge pull request #3780 from Vexu/stage2-async-review
Update use of async functions in self hosted compiler
This commit is contained in:
@@ -735,24 +735,26 @@ pub fn Watch(comptime V: type) type {
|
||||
allocator: *Allocator,
|
||||
|
||||
const OsData = switch (builtin.os) {
|
||||
.macosx, .freebsd, .netbsd, .dragonfly => struct {
|
||||
file_table: FileTable,
|
||||
table_lock: event.Lock,
|
||||
|
||||
const FileTable = std.StringHashMap(*Put);
|
||||
const Put = struct {
|
||||
putter_frame: @Frame(kqPutEvents),
|
||||
cancelled: bool = false,
|
||||
value: V,
|
||||
};
|
||||
},
|
||||
|
||||
// TODO https://github.com/ziglang/zig/issues/3778
|
||||
.macosx, .freebsd, .netbsd, .dragonfly => KqOsData,
|
||||
.linux => LinuxOsData,
|
||||
.windows => WindowsOsData,
|
||||
|
||||
else => @compileError("Unsupported OS"),
|
||||
};
|
||||
|
||||
const KqOsData = struct {
|
||||
file_table: FileTable,
|
||||
table_lock: event.Lock,
|
||||
|
||||
const FileTable = std.StringHashMap(*Put);
|
||||
const Put = struct {
|
||||
putter_frame: @Frame(kqPutEvents),
|
||||
cancelled: bool = false,
|
||||
value: V,
|
||||
};
|
||||
};
|
||||
|
||||
const WindowsOsData = struct {
|
||||
table_lock: event.Lock,
|
||||
dir_table: DirTable,
|
||||
@@ -1291,7 +1293,7 @@ pub fn Watch(comptime V: type) type {
|
||||
os.linux.EINVAL => unreachable,
|
||||
os.linux.EFAULT => unreachable,
|
||||
os.linux.EAGAIN => {
|
||||
global_event_loop.linuxWaitFd(self.os_data.inotify_fd, os.linux.EPOLLET | os.linux.EPOLLIN);
|
||||
global_event_loop.linuxWaitFd(self.os_data.inotify_fd, os.linux.EPOLLET | os.linux.EPOLLIN | os.EPOLLONESHOT);
|
||||
},
|
||||
else => unreachable,
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user