Rewrite Windows poll()

We can now await signals, files, pipes, and console simultaneously. This
change also gives a deeper review and testing to changes made yesterday.
This commit is contained in:
Justine Tunney 2024-09-10 18:59:06 -07:00
parent cceddd21b2
commit fbdf9d028c
No known key found for this signature in database
GPG key ID: BE714B4575D6E328
15 changed files with 425 additions and 191 deletions

View file

@ -22,6 +22,10 @@
#include "third_party/nsync/cv.h"
#include "third_party/nsync/futex.internal.h"
__static_yoink("nsync_mu_lock");
__static_yoink("nsync_mu_unlock");
__static_yoink("nsync_mu_trylock");
/**
* Wakes at least one thread waiting on condition, e.g.
*
@ -43,7 +47,7 @@ errno_t pthread_cond_signal(pthread_cond_t *cond) {
#if PTHREAD_USE_NSYNC
// do nothing if pthread_cond_timedwait() hasn't been called yet
// this is because we dont know for certain if nsync is safe
// this is because we dont know for certain if nsync use is safe
if (!atomic_load_explicit(&cond->_waited, memory_order_acquire))
return 0;