Make clock_nanosleep() cancel faster

This commit is contained in:
Justine Tunney 2023-11-18 18:12:09 -08:00
parent 0c89516ac5
commit e4dea37b8e
No known key found for this signature in database
GPG key ID: BE714B4575D6E328
2 changed files with 14 additions and 7 deletions

View file

@ -20,9 +20,8 @@
#include "libc/intrin/atomic.h"
#include "libc/intrin/weaken.h"
#include "libc/thread/posixthread.internal.h"
#ifdef __x86_64__
textwindows int _check_cancel(void) {
int _check_cancel(void) {
if (_weaken(_pthread_cancel_ack) && //
_pthread_self() && !(_pthread_self()->pt_flags & PT_NOCANCEL) &&
atomic_load_explicit(&_pthread_self()->pt_canceled,
@ -31,5 +30,3 @@ textwindows int _check_cancel(void) {
}
return 0;
}
#endif /* __x86_64__ */