quick addition of cosmo pthreads to python.com

- enable WITH_THREAD and _POSIX_THREADS
- add headers everywhere
- breaks only two tests (faulthandler and signal)
- disabled terminal completion because it causes segfaults for some
  reason (probably could not get the current thread)
This commit is contained in:
ahgamut 2023-02-23 10:08:42 +05:30 committed by Justine Tunney
parent a808b3e738
commit 60eb34509b
No known key found for this signature in database
GPG key ID: BE714B4575D6E328
16 changed files with 166 additions and 34 deletions

View file

@ -5,6 +5,11 @@
https://docs.python.org/3/license.html │
*/
#include "libc/assert.h"
#include "libc/calls/struct/timespec.h"
#include "libc/calls/struct/timeval.h"
#include "libc/errno.h"
#include "libc/thread/thread2.h"
#include "third_party/python/Include/dynamic_annotations.h"
#include "third_party/python/Include/pyerrors.h"
#include "third_party/python/Include/pymacro.h"
#include "third_party/python/Include/pymem.h"
@ -77,18 +82,18 @@ static size_t _pythread_stacksize = 0;
#ifdef _POSIX_THREADS
#define PYTHREAD_NAME "pthread"
#include "thread_pthread.inc"
#include "third_party/python/Python/thread_pthread.inc"
#endif
#ifdef NT_THREADS
#define PYTHREAD_NAME "nt"
#include "thread_nt.inc"
// #include "thread_nt.inc"
#endif
/*
#ifdef FOOBAR_THREADS
#include "thread_foobar.inc"
// #include "thread_foobar.inc"
#endif
*/