- File:
-
- 1 edited
-
libcfa/src/concurrency/iofwd.hfa (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
libcfa/src/concurrency/iofwd.hfa
r40a606d2 rff1240f 19 19 extern "C" { 20 20 #include <asm/types.h> 21 #include <sys/stat.h> // needed for mode_t22 21 #if CFA_HAVE_LINUX_IO_URING_H 23 22 #include <linux/io_uring.h> … … 25 24 } 26 25 #include "bits/defs.hfa" 27 #include "kernel/fwd.hfa"28 26 #include "time.hfa" 29 27 … … 49 47 50 48 struct cluster; 49 struct io_future_t; 51 50 struct $io_context; 52 51 … … 58 57 59 58 struct io_uring_sqe; 60 61 //-----------------------------------------------------------------------62 // IO user data63 struct io_future_t {64 future_t self;65 __s32 result;66 };67 68 static inline {69 thread$ * fulfil( io_future_t & this, __s32 result, bool do_unpark = true ) {70 this.result = result;71 return fulfil(this.self, do_unpark);72 }73 74 // Wait for the future to be fulfilled75 bool wait ( io_future_t & this ) { return wait (this.self); }76 void reset ( io_future_t & this ) { return reset (this.self); }77 bool available( io_future_t & this ) { return available(this.self); }78 }79 59 80 60 //---------- … … 153 133 // Check if a function is blocks a only the user thread 154 134 bool has_user_level_blocking( fptr_t func ); 155 156 #if CFA_HAVE_LINUX_IO_URING_H157 static inline void zero_sqe(struct io_uring_sqe * sqe) {158 sqe->flags = 0;159 sqe->ioprio = 0;160 sqe->fd = 0;161 sqe->off = 0;162 sqe->addr = 0;163 sqe->len = 0;164 sqe->fsync_flags = 0;165 sqe->__pad2[0] = 0;166 sqe->__pad2[1] = 0;167 sqe->__pad2[2] = 0;168 sqe->fd = 0;169 sqe->off = 0;170 sqe->addr = 0;171 sqe->len = 0;172 }173 #endif
Note:
See TracChangeset
for help on using the changeset viewer.