- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/libcfa/concurrency/kernel_private.h
rc81ebf9 r0c78741 21 21 #include "thread" 22 22 23 #include "alarm.h"24 25 23 //----------------------------------------------------------------------------- 26 24 // Scheduler … … 37 35 //----------------------------------------------------------------------------- 38 36 // Processor 39 coroutineprocessorCtx_t {37 struct processorCtx_t { 40 38 processor * proc; 39 coroutine_desc __cor; 41 40 }; 41 42 DECL_COROUTINE(processorCtx_t); 42 43 43 44 void main(processorCtx_t *); … … 46 47 void finishRunning(processor * this); 47 48 void spin(processor * this, unsigned int * spin_count); 48 49 struct system_proc_t {50 processor proc;51 52 alarm_list_t alarms;53 spinlock alarm_lock;54 55 bool pending_alarm;56 };57 58 extern cluster * systemCluster;59 extern system_proc_t * systemProcessor;60 extern thread_local processor * this_processor;61 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 }79 }80 49 81 50 //-----------------------------------------------------------------------------
Note:
See TracChangeset
for help on using the changeset viewer.