#include "Python.h"
#include "pycore_llist.h"
#include "pycore_lock.h"
#include "pycore_parking_lot.h"
#include "pycore_pyerrors.h"
#include "pycore_pystate.h"
#include "pycore_semaphore.h"
#include "pycore_time.h"
#include <stdbool.h>
Bucket;
struct wait_entry { … };
#define NUM_BUCKETS …
#define BUCKET_INIT(b, i) …
#define BUCKET_INIT_2(b, i) …
#define BUCKET_INIT_4(b, i) …
#define BUCKET_INIT_8(b, i) …
#define BUCKET_INIT_16(b, i) …
#define BUCKET_INIT_32(b, i) …
#define BUCKET_INIT_64(b, i) …
#define BUCKET_INIT_128(b, i) …
#define BUCKET_INIT_256(b, i) …
static Bucket buckets[NUM_BUCKETS] = …;
void
_PySemaphore_Init(_PySemaphore *sema)
{ … }
void
_PySemaphore_Destroy(_PySemaphore *sema)
{ … }
static int
_PySemaphore_PlatformWait(_PySemaphore *sema, PyTime_t timeout)
{ … }
int
_PySemaphore_Wait(_PySemaphore *sema, PyTime_t timeout, int detach)
{ … }
void
_PySemaphore_Wakeup(_PySemaphore *sema)
{ … }
static void
enqueue(Bucket *bucket, const void *address, struct wait_entry *wait)
{ … }
static struct wait_entry *
dequeue(Bucket *bucket, const void *address)
{ … }
static void
dequeue_all(Bucket *bucket, const void *address, struct llist_node *dst)
{ … }
static int
atomic_memcmp(const void *addr, const void *expected, size_t addr_size)
{ … }
int
_PyParkingLot_Park(const void *addr, const void *expected, size_t size,
PyTime_t timeout_ns, void *park_arg, int detach)
{ … }
void
_PyParkingLot_Unpark(const void *addr, _Py_unpark_fn_t *fn, void *arg)
{ … }
void
_PyParkingLot_UnparkAll(const void *addr)
{ … }
void
_PyParkingLot_AfterFork(void)
{ … }