- File:
-
- 1 edited
-
libcfa/src/concurrency/kernel.cfa (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
libcfa/src/concurrency/kernel.cfa
rae7adbc4 rd3605f8 142 142 extern void __disable_interrupts_hard(); 143 143 extern void __enable_interrupts_hard(); 144 145 static inline void __disable_interrupts_checked() { 146 /* paranoid */ verify( __preemption_enabled() ); 147 disable_interrupts(); 148 /* paranoid */ verify( ! __preemption_enabled() ); 149 } 150 151 static inline void __enable_interrupts_checked( bool poll = true ) { 152 /* paranoid */ verify( ! __preemption_enabled() ); 153 enable_interrupts( poll ); 154 /* paranoid */ verify( __preemption_enabled() ); 155 } 144 156 145 157 … … 737 749 738 750 // Check if there is a sleeping processor 739 // int fd = __atomic_load_n(&this->procs.fd, __ATOMIC_SEQ_CST); 740 int fd = 0; 741 if( __atomic_load_n(&this->procs.fd, __ATOMIC_SEQ_CST) != 0 ) { 742 fd = __atomic_exchange_n(&this->procs.fd, 0, __ATOMIC_RELAXED); 743 } 751 int fd = __atomic_load_n(&this->procs.fd, __ATOMIC_SEQ_CST); 744 752 745 753 // If no one is sleeping, we are done … … 768 776 // Unconditionnaly wake a thread 769 777 void __wake_proc(processor * this) { 770 /* paranoid */ verify( ! __preemption_enabled() );771 772 778 __cfadbg_print_safe(runtime_core, "Kernel : waking Processor %p\n", this); 773 779 774 eventfd_t val; 775 val = 1; 776 eventfd_write( this->idle_fd, val ); 777 778 /* paranoid */ verify( ! __preemption_enabled() ); 780 __disable_interrupts_checked(); 781 /* paranoid */ verify( ! __preemption_enabled() ); 782 eventfd_t val; 783 val = 1; 784 eventfd_write( this->idle_fd, val ); 785 __enable_interrupts_checked(); 779 786 } 780 787
Note:
See TracChangeset
for help on using the changeset viewer.