TD2 II.2 Finish thread Gracefuly
This commit is contained in:
parent
615d121a76
commit
feff887fa0
2 changed files with 8 additions and 3 deletions
|
@ -68,8 +68,13 @@ void do_ThreadExit(){
|
|||
DEBUG('x', "Enter do_ThreadExit function\n");
|
||||
// TODO: what should we do with thread space?
|
||||
// Probalely desallocate it... if no threads remain
|
||||
currentThread->space->Threads--;
|
||||
// currentThread->space->Threads--;
|
||||
DEBUG('x', "Decrease numbers of Threads:%d\n",currentThread->space->Threads);
|
||||
if ( --currentThread->space->Threads == 0){
|
||||
// No threads remains, desallocate addrspace
|
||||
delete currentThread->space;
|
||||
interrupt->Powerdown();
|
||||
}
|
||||
currentThread->Finish();
|
||||
}
|
||||
#endif
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue