I found some reference of `_Cancellation_beacon` in the bazel toolchain while searching on GitHub. https://github.com/ci-fuzz/bazel-toolchain/blob/4f42c70f17fd1a64bff2aa53a1a3...
I checked and the code is Apache2 Note: Licenses are only required to use copyrightable work without fair use, so you can use this as reference freely without risking you PR to fall under the Apache2 license as using it as a reference has already been considered fair use by law many times.
Also @piotr the PR you mentioned seems merged but not containing the commit you mentioned, I think this PR is still valid and just need a rebase. I checked the main wine code before saying that: https://gitlab.winehq.org/wine/wine/-/blob/master/dlls/msvcrt/concurrency.c