Skip to content

Commit

Permalink
Remove *NSYNC WIN32 semaphores
Browse files Browse the repository at this point in the history
This implementation doesn't work as well as WIN32 futexes. This code
path was only added back when we were having issues with set context
however that's been solved so we can go back to the much better code
  • Loading branch information
jart committed Nov 1, 2023
1 parent 7b284f6 commit d259e57
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 156 deletions.
10 changes: 0 additions & 10 deletions third_party/nsync/mu_semaphore.c
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,6 @@ void nsync_mu_semaphore_init (nsync_semaphore *s) {
return nsync_mu_semaphore_init_gcd (s);
} else if (IsNetbsd ()) {
return nsync_mu_semaphore_init_sem (s);
} else if (IsWindows ()) {
return nsync_mu_semaphore_init_win32 (s);
} else {
return nsync_mu_semaphore_init_futex (s);
}
Expand All @@ -50,8 +48,6 @@ void nsync_mu_semaphore_destroy (nsync_semaphore *s) {
return nsync_mu_semaphore_destroy_gcd (s);
} else if (IsNetbsd ()) {
return nsync_mu_semaphore_destroy_sem (s);
} else if (IsWindows ()) {
return nsync_mu_semaphore_destroy_win32 (s);
}
}

Expand All @@ -66,8 +62,6 @@ errno_t nsync_mu_semaphore_p (nsync_semaphore *s) {
err = nsync_mu_semaphore_p_gcd (s);
} else if (IsNetbsd ()) {
err = nsync_mu_semaphore_p_sem (s);
} else if (IsWindows ()) {
err = nsync_mu_semaphore_p_win32 (s);
} else {
err = nsync_mu_semaphore_p_futex (s);
}
Expand All @@ -86,8 +80,6 @@ errno_t nsync_mu_semaphore_p_with_deadline (nsync_semaphore *s, nsync_time abs_d
err = nsync_mu_semaphore_p_with_deadline_gcd (s, abs_deadline);
} else if (IsNetbsd ()) {
err = nsync_mu_semaphore_p_with_deadline_sem (s, abs_deadline);
} else if (IsWindows ()) {
err = nsync_mu_semaphore_p_with_deadline_win32 (s, abs_deadline);
} else {
err = nsync_mu_semaphore_p_with_deadline_futex (s, abs_deadline);
}
Expand All @@ -101,8 +93,6 @@ void nsync_mu_semaphore_v (nsync_semaphore *s) {
return nsync_mu_semaphore_v_gcd (s);
} else if (IsNetbsd ()) {
return nsync_mu_semaphore_v_sem (s);
} else if (IsWindows ()) {
return nsync_mu_semaphore_v_win32 (s);
} else {
return nsync_mu_semaphore_v_futex (s);
}
Expand Down
6 changes: 0 additions & 6 deletions third_party/nsync/mu_semaphore.internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,6 @@ errno_t nsync_mu_semaphore_p_gcd(nsync_semaphore *);
errno_t nsync_mu_semaphore_p_with_deadline_gcd(nsync_semaphore *, nsync_time);
void nsync_mu_semaphore_v_gcd(nsync_semaphore *);

void nsync_mu_semaphore_init_win32(nsync_semaphore *);
void nsync_mu_semaphore_destroy_win32(nsync_semaphore *);
errno_t nsync_mu_semaphore_p_win32(nsync_semaphore *);
errno_t nsync_mu_semaphore_p_with_deadline_win32(nsync_semaphore *, nsync_time);
void nsync_mu_semaphore_v_win32(nsync_semaphore *);

COSMOPOLITAN_C_END_
#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */
#endif /* COSMOPOLITAN_THIRD_PARTY_NSYNC_MU_SEMAPHORE_INTERNAL_H_ */
140 changes: 0 additions & 140 deletions third_party/nsync/mu_semaphore_win32.c

This file was deleted.

0 comments on commit d259e57

Please sign in to comment.