On Wed Mar 6 06:18:22 2024 +0000, Yuxuan Shui wrote:
@zhiyi's fix for the race in !5158 is much much nicer than mine. I updated this MR to build on top of that and also fix the memory leak. hopefully it's clearer now.
Hmm, i think the clearer version does have a use-after-free problem. If the item is freed in `queue_cancel_item` while `scheduled_item_cancelable_callback`/`waiting_item_cancelable_callback` is running, the latter will use-after-free.
I am afraid my original version is still the only way to do this. @zhiyi do you have thoughts? since you have worked on this part of code just recently?