#ifndef Py_INTERNAL_SEMAPHORE_H
#define Py_INTERNAL_SEMAPHORE_H
#ifndef Py_BUILD_CORE
# error "this header requires Py_BUILD_CORE define"
#endif
#include "pycore_pythread.h"
#ifdef MS_WINDOWS
#define WIN32_LEAN_AND_MEAN
# include <windows.h>
#elif defined(HAVE_PTHREAD_H)
# include <pthread.h>
#elif defined(HAVE_PTHREAD_STUBS)
# include "cpython/pthread_stubs.h"
#else
# error "Require native threads. See https://bugs.python.org/issue31370"
#endif
#if (defined(_POSIX_SEMAPHORES) && (_POSIX_SEMAPHORES+0) != -1 && \
defined(HAVE_SEM_TIMEDWAIT))
#define _Py_USE_SEMAPHORES
# include <semaphore.h>
#endif
#ifdef __cplusplus
extern "C" {
#endif
_PySemaphore;
PyAPI_FUNC(int)
_PySemaphore_Wait(_PySemaphore *sema, PyTime_t timeout_ns, int detach);
PyAPI_FUNC(void)
_PySemaphore_Wakeup(_PySemaphore *sema);
PyAPI_FUNC(void) _PySemaphore_Init(_PySemaphore *sema);
PyAPI_FUNC(void) _PySemaphore_Destroy(_PySemaphore *sema);
#ifdef __cplusplus
}
#endif
#endif