fix: false positive when looking for room to host pmem_list
[lunaix-os.git] / lunaix-os / includes / lunaix / iopoll.h
index 027f6fb23f9197f985e25b0c5a61823b02b141fe..dae362ca582cdb5a592a2965a6e75633f41a22dc 100644 (file)
@@ -3,10 +3,13 @@
 
 #include <lunaix/device.h>
 #include <lunaix/ds/llist.h>
-#include <lunaix/fs.h>
 
 #include <usr/lunaix/poll.h>
 
+struct thread;  // <lunaix/process.h>
+struct proc_info;  // <lunaix/process.h>
+struct v_fd;    // <lunaix/fs.h>
+
 typedef struct llist_header poll_evt_q;
 
 struct poll_opts
@@ -20,7 +23,7 @@ struct iopoller
 {
     poll_evt_q evt_listener;
     struct v_file* file_ref;
-    pid_t pid;
+    struct thread* thread;
 };
 
 struct iopoll
@@ -35,6 +38,12 @@ iopoll_listen_on(struct iopoller* listener, poll_evt_q* source)
     llist_append(source, &listener->evt_listener);
 }
 
+static inline void
+iopoll_init_evt_q(poll_evt_q* source)
+{
+    llist_init_head(source);
+}
+
 void
 iopoll_wake_pollers(poll_evt_q*);
 
@@ -42,13 +51,13 @@ void
 iopoll_init(struct iopoll*);
 
 void
-iopoll_free(pid_t, struct iopoll*);
+iopoll_free(struct proc_info*);
 
 int
-iopoll_install(pid_t, struct iopoll*, struct v_fd*);
+iopoll_install(struct thread* thread, struct v_fd* fd);
 
 int
-iopoll_remove(pid_t, struct iopoll*, int);
+iopoll_remove(struct thread*, int);
 
 static inline void
 poll_setrevt(struct poll_info* pinfo, int evt)