- File:
-
- 1 edited
-
src/libcfa/concurrency/kernel_private.h (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/libcfa/concurrency/kernel_private.h
r82ff5845 rc81ebf9 28 28 thread_desc * nextThread(cluster * this); 29 29 30 void BlockInternal(void);31 void BlockInternal(spinlock * lock);32 void BlockInternal(thread_desc * thrd);33 void BlockInternal(spinlock * lock, thread_desc * thrd);34 void BlockInternal(spinlock ** locks, unsigned short count);35 void BlockInternal(spinlock ** locks, unsigned short count, thread_desc ** thrds, unsigned short thrd_count);30 void ScheduleInternal(void); 31 void ScheduleInternal(spinlock * lock); 32 void ScheduleInternal(thread_desc * thrd); 33 void ScheduleInternal(spinlock * lock, thread_desc * thrd); 34 void ScheduleInternal(spinlock ** locks, unsigned short count); 35 void ScheduleInternal(spinlock ** locks, unsigned short count, thread_desc ** thrds, unsigned short thrd_count); 36 36 37 37 //----------------------------------------------------------------------------- … … 60 60 extern thread_local processor * this_processor; 61 61 62 extern "C" { 63 void disable_interrupts(); 64 void enable_interrupts_noRF(); 65 void enable_interrupts(); 62 static inline void disable_interrupts() { 63 __attribute__((unused)) unsigned short prev = __atomic_fetch_add_2( &this_processor->disable_preempt_count, 1, __ATOMIC_SEQ_CST ); 64 assert( prev != (unsigned short) -1 ); 65 } 66 67 static inline void enable_interrupts_noRF() { 68 unsigned short prev = __atomic_fetch_add_2( &this_processor->disable_preempt_count, -1, __ATOMIC_SEQ_CST ); 69 assert( prev != (unsigned short) 0 ); 70 } 71 72 static inline void enable_interrupts() { 73 unsigned short prev = __atomic_fetch_add_2( &this_processor->disable_preempt_count, -1, __ATOMIC_SEQ_CST ); 74 assert( prev != (unsigned short) 0 ); 75 if( prev == 1 && this_processor->pending_preemption ) { 76 ScheduleInternal( this_processor->current_thread ); 77 this_processor->pending_preemption = false; 78 } 66 79 } 67 80
Note:
See TracChangeset
for help on using the changeset viewer.