Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit a6e9758

Browse files
committed
Patch #497098: build support for GNU/Hurd.
1 parent 6529368 commit a6e9758

7 files changed

Lines changed: 341 additions & 254 deletions

File tree

Misc/ACKS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -301,6 +301,7 @@ Dom Mitchell
301301
Doug Moen
302302
The Dragon De Monsyne
303303
Skip Montanaro
304+
James A Morrison
304305
Sape Mullender
305306
Sjoerd Mullender
306307
Michael Muller

Misc/NEWS

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@ C API
3030

3131
New platforms
3232

33+
- GNU/Hurd is now supported.
34+
3335
Tests
3436

3537
Windows

Python/thread_cthread.h

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,26 @@
11

2+
#ifdef MACH_C_THREADS
23
#include <mach/cthreads.h>
4+
#endif
35

6+
#ifdef HURD_C_THREADS
7+
#include <cthreads.h>
8+
#endif
49

510
/*
611
* Initialization.
712
*/
813
static void
914
PyThread__init_thread(void)
1015
{
11-
cthread_init();
16+
#ifndef HURD_C_THREADS
17+
/* Roland McGrath said this should not be used since this is
18+
done while linking to threads */
19+
cthread_init();
20+
#else
21+
/* do nothing */
22+
;
23+
#endif
1224
}
1325

1426
/*
@@ -127,10 +139,10 @@ PyThread_acquire_lock(PyThread_type_lock lock, int waitflag)
127139

128140
dprintf(("PyThread_acquire_lock(%p, %d) called\n", lock, waitflag));
129141
if (waitflag) { /* blocking */
130-
mutex_lock(lock);
142+
mutex_lock((mutex_t)lock);
131143
success = TRUE;
132144
} else { /* non blocking */
133-
success = mutex_try_lock(lock);
145+
success = mutex_try_lock((mutex_t)lock);
134146
}
135147
dprintf(("PyThread_acquire_lock(%p, %d) -> %d\n", lock, waitflag, success));
136148
return success;

acconfig.h

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,12 @@
1919
/* Define if you have the Mach cthreads package */
2020
#undef C_THREADS
2121

22+
/* Define if you are using Mach cthreads under mach / */
23+
#undef MACH_C_THREADS
24+
25+
/* Define if you are using Mach cthreads directly under /include */
26+
#undef HURD_C_THREADS
27+
2228
/* Define to `long' if <time.h> doesn't define. */
2329
#undef clock_t
2430

@@ -47,6 +53,9 @@
4753
/* struct addrinfo (netdb.h) */
4854
#undef HAVE_ADDRINFO
4955

56+
/* Define if you have the getaddrinfo function. */
57+
#undef HAVE_GETADDRINFO
58+
5059
/* struct sockaddr_storage (sys/socket.h) */
5160
#undef HAVE_SOCKADDR_STORAGE
5261

0 commit comments

Comments
 (0)