diff options
| author | Martin v. Löwis <martin@v.loewis.de> | 2002-01-01 18:41:33 +0000 |
|---|---|---|
| committer | Martin v. Löwis <martin@v.loewis.de> | 2002-01-01 18:41:33 +0000 |
| commit | 025dee920e23d3b3673583f8972e48a5dd82a068 (patch) | |
| tree | b0da101e12b4c3a8d87fcf7ebd7e3efbf53dee21 /Python/thread_cthread.h | |
| parent | c9b16805c174c30891055d1d94340929ba8598ca (diff) | |
| download | cpython-025dee920e23d3b3673583f8972e48a5dd82a068.tar.gz | |
Patch #497098: build support for GNU/Hurd.
Diffstat (limited to 'Python/thread_cthread.h')
| -rw-r--r-- | Python/thread_cthread.h | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/Python/thread_cthread.h b/Python/thread_cthread.h index 8487cc295f..ccd774dca8 100644 --- a/Python/thread_cthread.h +++ b/Python/thread_cthread.h @@ -1,6 +1,11 @@ +#ifdef MACH_C_THREADS #include <mach/cthreads.h> +#endif +#ifdef HURD_C_THREADS +#include <cthreads.h> +#endif /* * Initialization. @@ -8,7 +13,14 @@ static void PyThread__init_thread(void) { - cthread_init(); +#ifndef HURD_C_THREADS + /* Roland McGrath said this should not be used since this is + done while linking to threads */ + cthread_init(); +#else +/* do nothing */ + ; +#endif } /* @@ -127,10 +139,10 @@ PyThread_acquire_lock(PyThread_type_lock lock, int waitflag) dprintf(("PyThread_acquire_lock(%p, %d) called\n", lock, waitflag)); if (waitflag) { /* blocking */ - mutex_lock(lock); + mutex_lock((mutex_t)lock); success = TRUE; } else { /* non blocking */ - success = mutex_try_lock(lock); + success = mutex_try_lock((mutex_t)lock); } dprintf(("PyThread_acquire_lock(%p, %d) -> %d\n", lock, waitflag, success)); return success; |
