Get deathstar demo working again on metal

This commit is contained in:
Justine Tunney 2024-07-04 03:44:17 -07:00
parent 15ea0524b3
commit bd6d9ff99a
No known key found for this signature in database
GPG key ID: BE714B4575D6E328
6 changed files with 21 additions and 17 deletions

View file

@ -34,7 +34,7 @@ int __tailcontext(const ucontext_t *);
* @see getcontext()
*/
int setcontext(const ucontext_t *uc) {
if (IsWindows()) {
if (IsWindows() || IsMetal()) {
atomic_store_explicit(&__get_tls()->tib_sigmask, uc->uc_sigmask,
memory_order_release);
} else {
@ -44,7 +44,7 @@ int setcontext(const ucontext_t *uc) {
}
int __getcontextsig(ucontext_t *uc) {
if (IsWindows()) {
if (IsWindows() || IsMetal()) {
uc->uc_sigmask =
atomic_load_explicit(&__get_tls()->tib_sigmask, memory_order_acquire);
return 0;
@ -54,7 +54,7 @@ int __getcontextsig(ucontext_t *uc) {
}
int __swapcontextsig(ucontext_t *x, const ucontext_t *y) {
if (IsWindows()) {
if (IsWindows() || IsMetal()) {
x->uc_sigmask = atomic_exchange_explicit(
&__get_tls()->tib_sigmask, y->uc_sigmask, memory_order_acquire);
return 0;