Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Simplify: tokio::select! will discard other futures when one future progress.

The discarded futures will never be run again.

Normally when a future is discarded it's dropped. When a future holding lock is dropped, lock is released, but it's passing future borrow to select so the discarded future is not dropped while holding lock.

So it leaves a future that holds a lock that will never run again.



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: