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

Skip to content

Commit a7a76d3

Browse files
committed
Patch #618347: Work around Solaris 2.6 pthread.h bug. Will backport to 2.2.
1 parent 3d61a06 commit a7a76d3

4 files changed

Lines changed: 25 additions & 3 deletions

File tree

Python/thread_pthread.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@
33

44
#include <stdlib.h>
55
#include <string.h>
6-
#ifdef __APPLE__
6+
#if defined(__APPLE__) || defined(HAVE_PTHREAD_DESTRUCTOR)
77
#define destructor xxdestructor
88
#endif
99
#include <pthread.h>
10-
#ifdef __APPLE__
10+
#if defined(__APPLE__) || defined(HAVE_PTHREAD_DESTRUCTOR)
1111
#undef destructor
1212
#endif
1313
#include <signal.h>

configure

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#! /bin/sh
2-
# From configure.in Revision: 1.348 .
2+
# From configure.in Revision: 1.349 .
33
# Guess values for system-dependent variables and create Makefiles.
44
# Generated by GNU Autoconf 2.53.
55
#
@@ -10885,6 +10885,17 @@ fi
1088510885
OSF1) LDLAST=-threads;;
1088610886
esac
1088710887
fi
10888+
10889+
if test "$posix_threads" = yes -a \
10890+
"$ac_sys_system" = "SunOS" -a \
10891+
"$ac_sys_release" = "5.6"; then
10892+
10893+
cat >>confdefs.h <<\_ACEOF
10894+
#define HAVE_PTHREAD_DESTRUCTOR 1
10895+
_ACEOF
10896+
10897+
fi
10898+
1088810899
fi
1088910900
1089010901
# Check for enable-ipv6

configure.in

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1326,6 +1326,14 @@ pthread_create (NULL, NULL, start_routine, NULL)], [
13261326
OSF1) LDLAST=-threads;;
13271327
esac
13281328
fi
1329+
1330+
if test "$posix_threads" = yes -a \
1331+
"$ac_sys_system" = "SunOS" -a \
1332+
"$ac_sys_release" = "5.6"; then
1333+
AC_DEFINE(HAVE_PTHREAD_DESTRUCTOR, 1,
1334+
[Defined for Solaris 2.6 bug in pthread header.])
1335+
fi
1336+
13291337
fi
13301338

13311339
# Check for enable-ipv6

pyconfig.h.in

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -304,6 +304,9 @@
304304
/* Define if you have GNU PTH threads. */
305305
#undef HAVE_PTH
306306

307+
/* Defined for Solaris 2.6 bug in pthread header. */
308+
#undef HAVE_PTHREAD_DESTRUCTOR
309+
307310
/* Define to 1 if you have the <pthread.h> header file. */
308311
#undef HAVE_PTHREAD_H
309312

0 commit comments

Comments
 (0)