You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When the leader thread exits, it doesn't notify other threads. So even if other threads are woken up or scheduled, they will continue to run instead of exiting.
One solution is to send signal to other threads which belong to the same process, and call exit function when handling the signal.
if current_task.is_leader(){loop{letmut all_exited = true;for task in process.tasks.lock().deref(){if !task.is_leader() && task.state() != TaskState::Exited{
all_exited = false;send_signal_to_thread(task.id().as_u64()asisize,SignalNo::SIGKILLasisize).unwrap();}}if !all_exited {yield_now();}else{break;}}
....}
The text was updated successfully, but these errors were encountered:
When the leader thread exits, it doesn't notify other threads. So even if other threads are woken up or scheduled, they will continue to run instead of exiting.
One solution is to send signal to other threads which belong to the same process, and call exit function when handling the signal.
The text was updated successfully, but these errors were encountered: