Ignore:
Timestamp:
Jun 29, 2018, 10:44:14 AM (6 years ago)
Author:
alain
Message:

Fix a bug in function sched_handle_signal():
When the deleted user thread is the last executed thread,
the sched->u_last field must be updated to point on another user thread.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/kernel/kern/process.c

    r446 r450  
    412412    cluster_process_copies_unlink( process );
    413413
    414     // remove process from children_list if process owner cluster
     414    // remove process from children_list
     415    // and release PID if owner cluster
    415416    if( CXY_FROM_PID( pid ) == local_cxy )
    416417    {
     
    429430            hal_remote_atomic_add( children_nr_xp , -1 );
    430431        remote_spinlock_unlock( children_lock_xp );
    431     }
    432 
    433     // release the process PID to cluster manager if process owner cluster
    434     if( CXY_FROM_PID( pid ) == local_cxy ) cluster_pid_release( pid );
     432
     433    // release the process PID to cluster manager
     434    cluster_pid_release( pid );
     435
     436    }
    435437
    436438    // FIXME close all open files and update dirty [AG]
     
    10571059    // remove thread from th_tbl[]
    10581060    process->th_tbl[ltid] = NULL;
    1059     process->th_nr--;
     1061    process->th_nr = count-1;
    10601062
    10611063    // release lock protecting th_tbl
     
    10651067    return (count == 1);
    10661068
    1067 }  // process_remove_thread()
     1069}  // end process_remove_thread()
    10681070
    10691071/////////////////////////////////////////////////////////
Note: See TracChangeset for help on using the changeset viewer.