unpredictable task increments when user attempts selfstop
Closed this issue · 3 comments
JadKHaddad commented
it's up to tokio to decide wether the add_task function or the cancellation_token will be executed first, thus leading to unpredictable increments of tasks if user attempts selfstop (this is undefined behavior)
JadKHaddad commented
move "add_task" to
select! {
...
_ = task_call_and_sleep => {
//here
...
}
JadKHaddad commented
JadKHaddad commented
check