Changeset e9c0b4c for libcfa/src
- Timestamp:
- Apr 24, 2021, 9:05:30 PM (3 years ago)
- Branches:
- ADT, arm-eh, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, master, new-ast-unique-expr, pthread-emulation, qualifiedEnum
- Children:
- adaee12
- Parents:
- 28d426a
- Location:
- libcfa/src/concurrency
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
libcfa/src/concurrency/io.cfa
r28d426a re9c0b4c 40 40 #include "kernel.hfa" 41 41 #include "kernel/fwd.hfa" 42 #include "kernel_private.hfa" 42 43 #include "io/types.hfa" 43 44 … … 89 90 static inline unsigned __flush( struct $io_context & ); 90 91 static inline __u32 __release_sqes( struct $io_context & ); 92 extern void __kernel_unpark( $thread * thrd ); 91 93 92 94 bool __cfa_io_drain( processor * proc ) { 93 95 /* paranoid */ verify( ! __preemption_enabled() ); 96 /* paranoid */ verify( ready_schedule_islocked() ); 94 97 /* paranoid */ verify( proc ); 95 98 /* paranoid */ verify( proc->io.ctx ); … … 115 118 __cfadbg_print_safe( io, "Kernel I/O : Syscall completed : cqe %p, result %d for %p\n", &cqe, cqe.res, future ); 116 119 117 fulfil( *future, cqe.res);120 __kernel_unpark( fulfil( *future, cqe.res, false ) ); 118 121 } 119 122 … … 124 127 __atomic_store_n( ctx->cq.head, head + count, __ATOMIC_SEQ_CST ); 125 128 129 /* paranoid */ verify( ready_schedule_islocked() ); 126 130 /* paranoid */ verify( ! __preemption_enabled() ); 127 131 -
libcfa/src/concurrency/kernel.cfa
r28d426a re9c0b4c 551 551 // Scheduler routines 552 552 // KERNEL ONLY 553 void __schedule_thread( $thread * thrd ) {553 static void __schedule_thread( $thread * thrd ) { 554 554 /* paranoid */ verify( ! __preemption_enabled() ); 555 555 /* paranoid */ verify( kernelTLS().this_proc_id ); … … 659 659 } 660 660 661 void __kernel_unpark( $thread * thrd ) { 662 /* paranoid */ verify( ! __preemption_enabled() ); 663 /* paranoid */ verify( ready_schedule_islocked()); 664 665 if( !thrd ) return; 666 667 if(__must_unpark(thrd)) { 668 // Wake lost the race, 669 __schedule_thread( thrd ); 670 } 671 672 /* paranoid */ verify( ready_schedule_islocked()); 673 /* paranoid */ verify( ! __preemption_enabled() ); 674 } 675 661 676 void unpark( $thread * thrd ) { 662 677 if( !thrd ) return; … … 871 886 872 887 static inline bool __maybe_io_drain( processor * proc ) { 888 bool ret = false; 873 889 #if defined(CFA_HAVE_LINUX_IO_URING_H) 874 890 __cfadbg_print_safe(runtime_core, "Kernel : core %p checking io for ring %d\n", proc, proc->io.ctx->fd); … … 879 895 unsigned tail = *ctx->cq.tail; 880 896 if(head == tail) return false; 881 ret urn__cfa_io_drain( proc );897 ret = __cfa_io_drain( proc ); 882 898 #endif 899 return ret; 883 900 } 884 901
Note: See TracChangeset
for help on using the changeset viewer.