Make futexes cancellable by pthreads

This commit is contained in:
Justine Tunney 2022-11-04 18:19:05 -07:00
parent 2278327eba
commit 022536cab6
No known key found for this signature in database
GPG key ID: BE714B4575D6E328
101 changed files with 627 additions and 391 deletions

View file

@ -20,6 +20,7 @@
#include "libc/intrin/safemacros.internal.h"
#include "libc/log/internal.h"
#include "libc/runtime/runtime.h"
#include "libc/thread/thread.h"
/**
* Prints initial part of fatal message.
@ -27,6 +28,7 @@
* @note this is support code for __check_fail(), __assert_fail(), etc.
*/
relegated void __start_fatal(const char *file, int line) {
pthread_setcancelstate(PTHREAD_CANCEL_DISABLE, 0);
__restore_tty();
kprintf("%r%serror%s:%s:%d:%s%s: ", !__nocolor ? "\e[J\e[30;101m" : "",
!__nocolor ? "\e[94;49m" : "", file, line,