Changeset b79207d in mainline for kernel/generic/src/main/shutdown.c
- Timestamp:
- 2019-07-18T17:19:02Z (6 years ago)
- Parents:
- bb580548
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/generic/src/main/shutdown.c
rbb580548 rb79207d 98 98 } 99 99 100 void abort_shutdown() 101 { 102 irq_spinlock_lock(&threads_lock, true); 103 thread_t *thread = atomic_load(&shutdown_thread); 104 if (thread != NULL) { 105 thread_interrupt(thread); 106 atomic_store(&shutdown_thread, NULL); 107 } 108 irq_spinlock_unlock(&threads_lock, true); 109 } 110 100 111 /* argument structure for the shutdown thread */ 101 112 typedef struct { … … 135 146 #endif 136 147 137 irq_spinlock_lock(&threads_lock, true); 138 thread_t *thread = atomic_load(&shutdown_thread); 139 if (thread != NULL) { 140 thread_interrupt(thread); 141 atomic_store(&shutdown_thread, NULL); 142 } 143 irq_spinlock_unlock(&threads_lock, true); 148 abort_shutdown(); 144 149 145 150 /* `cancel` or default has been called */ … … 165 170 arg->delay = delay; 166 171 167 thread = thread_create(sys_shutdown_function, arg, kernel_task, THREAD_FLAG_NONE, "shutdown");172 thread_t *thread = thread_create(sys_shutdown_function, arg, kernel_task, THREAD_FLAG_NONE, "shutdown"); 168 173 169 174 if (thread == NULL) {
Note:
See TracChangeset
for help on using the changeset viewer.