Changeset 16 for trunk/kernel/syscalls/sys_thread_exit.c
- Timestamp:
- May 10, 2017, 5:04:01 PM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/kernel/syscalls/sys_thread_exit.c
r1 r16 32 32 int sys_thread_exit ( void * exit_val ) 33 33 { 34 thread_t * this = current_thread;35 c pu_t * cpu = current_cpu;36 uint32_t state;37 bool_t isEmpty;38 bool_t isReleased;34 thread_t * this = CURRENT_THREAD; 35 core_t * core = this->core; 36 bool_t isEmpty; 37 bool_t isReleased; 38 uint32_t irq_state; 39 39 40 /* TODO: the cpu->lid must match the core index in the logical cluster */ 41 if(this->process->pid != 1) 42 dqdt_update_threads_number( local_cxy , cpu->lid , -1 ); 40 // update DQDT TODO must be done by thread destroy 41 if(this->process->pid != 1) dqdt_local_update_threads( -1 ); 43 42 44 43 spinlock_lock( &this->lock ); … … 46 45 if(!(thread_isJoinable(this))) 47 46 { 48 spinlock_unlock_nosched(&this->lock);49 47 goto exit_dead; 50 48 } 51 49 52 // Check if there's a thread waiting the end of call eethread50 // Check if there's a thread waiting the end of calling thread 53 51 isEmpty = wait_queue_isEmpty(&this->info.wait_queue); 54 52 … … 72 70 73 71 // Release FPU if required 74 cpu_disable_all_irq(&state);75 if(c urrent_cpu->fpu_owner == this)72 hal_disable_irq( &irq_state ); 73 if(core->fpu_owner == this) 76 74 { 77 c urrent_cpu->fpu_owner = NULL;75 core->fpu_owner = NULL; 78 76 isReleased = true; 79 77 } 80 cpu_restore_irq(state);78 hal_restore_irq( irq_state ); 81 79 82 80 if(isReleased)
Note: See TracChangeset
for help on using the changeset viewer.