XboxDev / nxdk-pdclib

The Public Domain C Library (adapted for original Xbox / nxdk toolchain)
http://pdclib.rootdirectory.de
Creative Commons Zero v1.0 Universal
19 stars 9 forks source link

xbox: Use Win32 functions as a backend for C11 threads / TSS #35

Closed thrimbor closed 3 years ago

thrimbor commented 4 years ago

This is a rewrite of the C11 threads and TSS implementation, basing it on the Win32 implementation. This ensures cross-compatibility, where before it was not possible to use C11 TSS in Win32 threads or vice-versa. I've recently worked on removing the use of implicit TLS in nxdk itself, which requires these changes to have C11 threads still work.

I've hacked a quick test together to show that TSS still works: https://gist.github.com/thrimbor/014267da6a1c815b2e89bc00c694ba82

thrimbor commented 3 years ago

It looks like nobody except me has looked at this yet, but I'd really like to merge this soon, because I have other stuff that relies on it and it fixes some actual issues in C11 / Win32 compatibility.

dracc commented 3 years ago

Code changes look good, test program builds and runs as expected.