pythread.h 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. #ifndef Py_PYTHREAD_H
  2. #define Py_PYTHREAD_H
  3. typedef void *PyThread_type_lock;
  4. typedef void *PyThread_type_sema;
  5. #ifdef __cplusplus
  6. extern "C" {
  7. #endif
  8. PyAPI_FUNC(void) PyThread_init_thread(void);
  9. PyAPI_FUNC(long) PyThread_start_new_thread(void (*)(void *), void *);
  10. PyAPI_FUNC(void) PyThread_exit_thread(void);
  11. PyAPI_FUNC(long) PyThread_get_thread_ident(void);
  12. PyAPI_FUNC(PyThread_type_lock) PyThread_allocate_lock(void);
  13. PyAPI_FUNC(void) PyThread_free_lock(PyThread_type_lock);
  14. PyAPI_FUNC(int) PyThread_acquire_lock(PyThread_type_lock, int);
  15. #define WAIT_LOCK 1
  16. #define NOWAIT_LOCK 0
  17. PyAPI_FUNC(void) PyThread_release_lock(PyThread_type_lock);
  18. PyAPI_FUNC(size_t) PyThread_get_stacksize(void);
  19. PyAPI_FUNC(int) PyThread_set_stacksize(size_t);
  20. /* Thread Local Storage (TLS) API */
  21. PyAPI_FUNC(int) PyThread_create_key(void);
  22. PyAPI_FUNC(void) PyThread_delete_key(int);
  23. PyAPI_FUNC(int) PyThread_set_key_value(int, void *);
  24. PyAPI_FUNC(void *) PyThread_get_key_value(int);
  25. PyAPI_FUNC(void) PyThread_delete_key_value(int key);
  26. /* Cleanup after a fork */
  27. PyAPI_FUNC(void) PyThread_ReInitTLS(void);
  28. #ifdef __cplusplus
  29. }
  30. #endif
  31. #endif /* !Py_PYTHREAD_H */