Changes in uspace/lib/c/generic/thread.c [47b7006:63f8966] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/c/generic/thread.c
r47b7006 r63f8966 31 31 */ 32 32 /** @file 33 */ 33 */ 34 34 35 35 #include <thread.h> … … 41 41 #include <str.h> 42 42 #include <async.h> 43 #include "private/thread.h"44 43 45 44 #ifndef THREAD_INITIAL_STACK_PAGES_NO … … 51 50 * This function is called from __thread_entry() and is used 52 51 * to call the thread's implementing function and perform cleanup 53 * and exit when thread returns back. 52 * and exit when thread returns back. Do not call this function 53 * directly. 54 54 * 55 55 * @param uarg Pointer to userspace argument structure. 56 *57 56 */ 58 57 void __thread_main(uspace_arg_t *uarg) 59 58 { 60 fibril_t *fibril = fibril_setup(); 61 if (fibril == NULL) 62 thread_exit(0); 63 64 __tcb_set(fibril->tcb); 65 59 fibril_t *f; 60 61 f = fibril_setup(); 62 __tcb_set(f->tcb); 63 66 64 uarg->uspace_thread_function(uarg->uspace_thread_arg); 67 /* XXX: we cannot free the userspace stack while running on it 68 free(uarg->uspace_stack); 69 free(uarg); 70 */ 71 65 /* XXX: we cannot free the userspace stack while running on it */ 66 // free(uarg->uspace_stack); 67 // free(uarg); 68 72 69 /* If there is a manager, destroy it */ 73 70 async_destroy_manager(); 74 fibril_teardown(f ibril);75 71 fibril_teardown(f); 72 76 73 thread_exit(0); 77 74 } … … 130 127 * 131 128 * @param status Exit status. Currently not used. 132 *133 129 */ 134 130 void thread_exit(int status) 135 131 { 136 132 __SYSCALL1(SYS_THREAD_EXIT, (sysarg_t) status); 137 138 /* Unreachable */ 139 while (1); 133 for (;;) 134 ; 140 135 } 141 136
Note:
See TracChangeset
for help on using the changeset viewer.