On Fri Apr 14 16:32:58 2023 +0000, Piotr Caban wrote:
I've pushed changed version of your patches:
- removed _Cancellation_beacon patches - I think it needs more
investigation, I'm not saying that I'm against such a stub but I think we should try harder to understand what it does, I didn't have time to do it now, please open new MR with _Cancellation_beacon changes
- correct IsSynchronouslyBlocked virtual function offset
- add missing ExternalContextBase virtual functions
- use Context blocking functions in reader_writer_lock to show how it
should be implemented to get IsSynchronouslyBlocked working The IsSynchronouslyBlocked function will often return wrong values now. It would be nice to rewrite other functions to use Block()/Unblock(). In order to implement timed waits separate thread/threadpool will need to be used.
I didn't think that this is how `IsSynchronouslyBlocked` was implemented, I thought it was unrelated to `Block`, but this makes sense.
This implementation of `Block`/`Unblock` is racy though, an earlier call to `Unblock` doesn't unblock a later call to `Block`, while the documentation explicitly states that it should. But that's an easy fix, I'll just make `blocked` a LONG.