Improve Python's threading story

Python threads are now generally working, however some parts of Python's
regression tests for threads are flaky. This is possibly due to needing
more locking primitives in Cosmo's IO system call wrappers, e.g. close.

    make o//third_party/python/Lib/test/test_threading.py.runs

See #747
This commit is contained in:
Justine Tunney 2023-02-23 06:51:51 -08:00
parent 60eb34509b
commit b15f9eb58f
No known key found for this signature in database
GPG key ID: BE714B4575D6E328
9 changed files with 72 additions and 30 deletions

View file

@ -1,6 +1,7 @@
#ifndef MULTIPROCESSING_H
#define MULTIPROCESSING_H
#define PY_SSIZE_T_CLEAN
#include "libc/thread/semaphore.h"
#include "third_party/python/Include/Python.h"
#include "third_party/python/Include/pythread.h"
#include "third_party/python/Include/structmember.h"

View file

@ -4,6 +4,8 @@
Python 3
https://docs.python.org/3/license.html │
*/
#include "libc/sysv/consts/o.h"
#include "libc/thread/semaphore.h"
#include "third_party/python/Modules/_multiprocessing/multiprocessing.h"
/* clang-format off */