Changeset 416 for trunk/kernel/kern/scheduler.h
- Timestamp:
- Jan 4, 2018, 10:05:47 AM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/kernel/kern/scheduler.h
r409 r416 40 40 typedef struct scheduler_s 41 41 { 42 spinlock_t lock; /*! readlock protecting lists of threads*/43 uint16_t u_threads_nr; /*! total numbre of attached user threads*/44 uint16_t k_threads_nr; /*! total number of attached kernel threads*/45 list_entry_t u_root; /*! root of list of user threads for this scheduler*/46 list_entry_t k_root; /*! root of list of kernel threads for this scheduler*/47 list_entry_t * u_last; /*! pointer on list_entry for last executed k_thread*/48 list_entry_t * k_last; /*! pointer on list entry for last executed u_thread*/49 struct thread_s * idle; /*! pointer on idle thread*/50 struct thread_s * current; /*! pointer on current running thread*/51 bool_t sig_pending; /*! signal_handller must be called when true*/42 spinlock_t lock; /*! readlock protecting lists of threads */ 43 uint16_t u_threads_nr; /*! total number of attached user threads */ 44 uint16_t k_threads_nr; /*! total number of attached kernel threads */ 45 list_entry_t u_root; /*! root of list of user threads */ 46 list_entry_t k_root; /*! root of list of kernel threads */ 47 list_entry_t * u_last; /*! pointer on list_entry for last executed k_thread */ 48 list_entry_t * k_last; /*! pointer on list entry for last executed u_thread */ 49 struct thread_s * idle; /*! pointer on idle thread */ 50 struct thread_s * current; /*! pointer on current running thread */ 51 bool_t req_ack_pending; /*! signal_handller must be called when true */ 52 52 } 53 53 scheduler_t; … … 67 67 struct thread_s * thread ); 68 68 69 /*********************************************************************************************70 * This function remove a thread from its scheduler.re scheduler.71 *********************************************************************************************72 * @ thread : local pointer on the thread descriptor.73 ********************************************************************************************/74 void sched_remove_thread( struct thread_s * thread );75 76 69 /********************************************************************************************* 77 70 * This function is the only method to make a context switch. It is called in cas of TICK, … … 87 80 88 81 /********************************************************************************************* 89 * This function scan all threads attached to a given core scheduler, and executes 90 * the relevant actions for pending KILL or EXIT signals. 91 * It is called in by the sched_yield() function, with IRQ disabled. 82 * This function scan all threads attached to a given scheduler, and executes the relevant 83 * actions for pending THREAD_FLAG_REQ_ACK or THREAD_FLAG_REQ_DELETE requests. 84 * It is called in by the sched_yield() function, with IRQ disabled. 85 * - REQ_ACK : it checks that target thread is blocked, decrements the response counter 86 * to acknowledge the client thread, and reset the pending request. 87 * - REQ_DELETE : it detach the target thread from parent if attached, detach it from 88 * the process, remove it from scheduler, release memory allocated to thread descriptor, 89 * and destroy the process descriptor it the target thread was the last thread. 92 90 ********************************************************************************************* 93 91 * @ core : local pointer on the core descriptor. 94 92 ********************************************************************************************/ 95 void sched_handle_ signals( struct core_s * core );93 void sched_handle_requests( struct core_s * core ); 96 94 97 95 /********************************************************************************************* … … 113 111 114 112 /********************************************************************************************* 115 * This function unlink a thread identified by the <thread> pointer from its process.116 * It is called by the sched_handle_signals() function when one EXIT or KILL signal is set,117 * and it implement the first step of a thread destructionebut can also be directly called by a local killer thread signal.118 * - It detach the thread from the scheduler.119 * - It detach the thread from the process.120 * - It detach the thread from the parent thread when the thread is attached.121 * - It destroys the thread descriptor.122 * - It acknowledge the killer thread if it's a kill signal123 *********************************************************************************************124 * @ thread : pointer on thread to be killed.125 ********************************************************************************************/126 void sched_kill_thread( struct thread_s * thread );127 128 /*********************************************************************************************129 113 * This function display the internal state of the local core identified by its <lid>. 130 114 *********************************************************************************************
Note: See TracChangeset
for help on using the changeset viewer.