Changeset 86d05fae in mainline for libc/generic/psthread.c
- Timestamp:
- 2006-03-24T11:05:41Z (19 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 4f2c821
- Parents:
- a71d9af9
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
libc/generic/psthread.c
ra71d9af9 r86d05fae 33 33 #include <thread.h> 34 34 #include <stdio.h> 35 #include <kernel/arch/faddr.h> 35 36 36 37 static LIST_INITIALIZE(ready_list); 38 39 static void ps_exit(void) __attribute__ ((noinline)); 37 40 38 41 /** Function to preempt to other thread without adding 39 42 * currently running thread to runqueue 40 43 */ 41 staticvoid ps_exit(void)44 void ps_exit(void) 42 45 { 43 46 psthread_data_t *pt; … … 88 91 int ps_join(pstid_t psthrid) 89 92 { 90 psthread_data_t *pt, *mypt;91 int retval;93 volatile psthread_data_t *pt, *mypt; 94 volatile int retval; 92 95 93 96 /* Handle psthrid = Kernel address -> it is wait for call */ … … 97 100 if (!pt->finished) { 98 101 mypt = __tls_get(); 99 if (context_save(& mypt->ctx)) {100 pt->waiter = mypt;102 if (context_save(&((psthread_data_t *) mypt)->ctx)) { 103 pt->waiter = (psthread_data_t *) mypt; 101 104 ps_exit(); 102 105 } … … 105 108 106 109 free(pt->stack); 107 __free_tls( pt);110 __free_tls((psthread_data_t *) pt); 108 111 109 112 return retval; … … 131 134 132 135 context_save(&pt->ctx); 133 context_set(&pt->ctx, psthread_main, pt->stack, getpagesize(), pt);136 context_set(&pt->ctx, FADDR(psthread_main), pt->stack, getpagesize(), pt); 134 137 135 138 list_append(&pt->list, &ready_list);
Note:
See TracChangeset
for help on using the changeset viewer.