Changeset 29a9f62 in mainline for libc/generic/thread.c
- Timestamp:
- 2006-03-23T10:33:55Z (19 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 77bd004
- Parents:
- 1cef26f
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
libc/generic/thread.c
r1cef26f r29a9f62 32 32 #include <arch/faddr.h> 33 33 #include <kernel/proc/uarg.h> 34 #include <psthread.h> 35 36 #include <stdio.h> 37 void * __make_tls(void) 38 { 39 psthread_data_t *pt; 40 41 pt = malloc(sizeof(psthread_data_t)); 42 pt->self = pt; 43 44 return pt; 45 } 46 47 void __free_tls(void *tls) 48 { 49 free(tls); 50 } 34 51 35 52 /** Main thread function. … … 42 59 * @param uarg Pointer to userspace argument structure. 43 60 */ 44 void thread_main(uspace_arg_t *uarg)61 void __thread_main(uspace_arg_t *uarg) 45 62 { 63 /* This should initialize the area according to TLS specicification */ 64 __tls_set(__make_tls()); 65 46 66 uarg->uspace_thread_function(uarg->uspace_thread_arg); 47 67 free(uarg->uspace_stack); 48 68 free(uarg); 69 70 __free_tls(__tls_get()); 71 49 72 thread_exit(0); 50 73 }
Note:
See TracChangeset
for help on using the changeset viewer.