home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / py2s152.zip / Include / pythread.h < prev    next >
C/C++ Source or Header  |  1999-06-27  |  3KB  |  88 lines

  1. #ifndef Py_PYTHREAD_H
  2. #define Py_PYTHREAD_H
  3.  
  4. /***********************************************************
  5. Copyright 1991-1995 by Stichting Mathematisch Centrum, Amsterdam,
  6. The Netherlands.
  7.  
  8.                         All Rights Reserved
  9.  
  10. Permission to use, copy, modify, and distribute this software and its
  11. documentation for any purpose and without fee is hereby granted,
  12. provided that the above copyright notice appear in all copies and that
  13. both that copyright notice and this permission notice appear in
  14. supporting documentation, and that the names of Stichting Mathematisch
  15. Centrum or CWI or Corporation for National Research Initiatives or
  16. CNRI not be used in advertising or publicity pertaining to
  17. distribution of the software without specific, written prior
  18. permission.
  19.  
  20. While CWI is the initial source for this software, a modified version
  21. is made available by the Corporation for National Research Initiatives
  22. (CNRI) at the Internet address ftp://ftp.python.org.
  23.  
  24. STICHTING MATHEMATISCH CENTRUM AND CNRI DISCLAIM ALL WARRANTIES WITH
  25. REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF
  26. MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL STICHTING MATHEMATISCH
  27. CENTRUM OR CNRI BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL
  28. DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
  29. PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
  30. TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  31. PERFORMANCE OF THIS SOFTWARE.
  32.  
  33. ******************************************************************/
  34.  
  35. #define NO_EXIT_PROG        /* don't define PyThread_exit_prog() */
  36.                 /* (the result is no use of signals on SGI) */
  37.  
  38. #ifndef Py_PROTO
  39. #if defined(__STDC__) || defined(__cplusplus)
  40. #define Py_PROTO(args)    args
  41. #else
  42. #define Py_PROTO(args)    ()
  43. #endif
  44. #endif
  45.  
  46. typedef void *PyThread_type_lock;
  47. typedef void *PyThread_type_sema;
  48.  
  49. #ifdef __cplusplus
  50. extern "C" {
  51. #endif
  52.  
  53. DL_IMPORT(void) PyThread_init_thread Py_PROTO((void));
  54. DL_IMPORT(int) PyThread_start_new_thread Py_PROTO((void (*)(void *), void *));
  55. DL_IMPORT(void) PyThread_exit_thread Py_PROTO((void));
  56. DL_IMPORT(void) PyThread__PyThread_exit_thread Py_PROTO((void));
  57. DL_IMPORT(long) PyThread_get_thread_ident Py_PROTO((void));
  58.  
  59. DL_IMPORT(PyThread_type_lock) PyThread_allocate_lock Py_PROTO((void));
  60. DL_IMPORT(void) PyThread_free_lock Py_PROTO((PyThread_type_lock));
  61. DL_IMPORT(int) PyThread_acquire_lock Py_PROTO((PyThread_type_lock, int));
  62. #define WAIT_LOCK    1
  63. #define NOWAIT_LOCK    0
  64. DL_IMPORT(void) PyThread_release_lock Py_PROTO((PyThread_type_lock));
  65.  
  66. DL_IMPORT(PyThread_type_sema) PyThread_allocate_sema Py_PROTO((int));
  67. DL_IMPORT(void) PyThread_free_sema Py_PROTO((PyThread_type_sema));
  68. DL_IMPORT(int) PyThread_down_sema Py_PROTO((PyThread_type_sema, int));
  69. #define WAIT_SEMA    1
  70. #define NOWAIT_SEMA    0
  71. DL_IMPORT(void) PyThread_up_sema Py_PROTO((PyThread_type_sema));
  72.  
  73. #ifndef NO_EXIT_PROG
  74. DL_IMPORT(void) PyThread_exit_prog Py_PROTO((int));
  75. DL_IMPORT(void) PyThread__PyThread_exit_prog Py_PROTO((int));
  76. #endif
  77.  
  78. DL_IMPORT(int) PyThread_create_key Py_PROTO((void));
  79. DL_IMPORT(void) PyThread_delete_key Py_PROTO((int));
  80. DL_IMPORT(int) PyThread_set_key_value Py_PROTO((int, void *));
  81. DL_IMPORT(void *) PyThread_get_key_value Py_PROTO((int));
  82.  
  83. #ifdef __cplusplus
  84. }
  85. #endif
  86.  
  87. #endif /* !Py_PYTHREAD_H */
  88.