Changeset 6a0e568 in mainline for kernel/generic/src/proc/thread.c
- Timestamp:
- 2024-01-19T16:56:48Z (18 months ago)
- Branches:
- master
- Children:
- 286da52
- Parents:
- c1eaec4
- git-author:
- Jiří Zárevúcky <zarevucky.jiri@…> (2023-02-22 18:04:40)
- git-committer:
- Jiří Zárevúcky <zarevucky.jiri@…> (2024-01-19 16:56:48)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/generic/src/proc/thread.c
rc1eaec4 r6a0e568 108 108 static int threads_cmp(void *, void *); 109 109 110 /** Thread wrapper.111 *112 * This wrapper is provided to ensure that every thread makes a call to113 * thread_exit() when its implementing function returns.114 *115 * interrupts_disable() is assumed.116 *117 */118 static void cushion(void)119 {120 void (*f)(void *) = THREAD->thread_code;121 void *arg = THREAD->thread_arg;122 123 /* This is where each thread wakes up after its creation */124 interrupts_enable();125 126 f(arg);127 128 thread_exit();129 130 /* Not reached */131 }132 133 110 /** Initialization and allocation for thread_t structure 134 111 * … … 309 286 irq_spinlock_unlock(&tidlock, true); 310 287 311 context_create(&thread->saved_context, cushion, thread->kstack, STACK_SIZE); 288 context_create(&thread->saved_context, thread_main_func, 289 thread->kstack, STACK_SIZE); 312 290 313 291 current_initialize((current_t *) thread->kstack);
Note:
See TracChangeset
for help on using the changeset viewer.