How to make a manual future implementation into a async fn

I have this simple Accept Future manually implemented as:

I thought (naively) of making it into an async function (and changed the mutex inside lock_resource_table to use Future-aware one from the futures crate.

But this doesn't work the same way as original because in the original case the lock was held only when the future was polled but in the latter case, it is held until the accept future resolves.

How can I implement the above future correctly as an async function?

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.