summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJarkko Hietaniemi <jhi@iki.fi>1999-03-02 23:12:36 +0000
committerJarkko Hietaniemi <jhi@iki.fi>1999-03-02 23:12:36 +0000
commit227c31c3430bbf328868bf1f4c9abf171e662db9 (patch)
treea7dabd50074b7b264d48d7a34adc0436bcc715df
parent7d4ba924cffa17b20a2c7f77186bab223278f3d5 (diff)
downloadperl-227c31c3430bbf328868bf1f4c9abf171e662db9.tar.gz
The HP-UX threads patch (change #3028) is needed also here.
p4raw-link: @3028 on //depot/maint-5.005/perl: d9761d5fa9df9e662778f8ca3ed55c2e3037a72a p4raw-id: //depot/cfgperl@3052
-rw-r--r--hints/hpux.sh9
-rw-r--r--thread.h14
2 files changed, 20 insertions, 3 deletions
diff --git a/hints/hpux.sh b/hints/hpux.sh
index 70250b7a75..b215335c72 100644
--- a/hints/hpux.sh
+++ b/hints/hpux.sh
@@ -237,11 +237,14 @@ EOM
# instead of fd_set * (just like 9.X)
selecttype='int *'
;;
- 11 | 12) # 12 may want upping the _POSIX_C_SOURCE
- ccflags="$ccflags -D_POSIX_C_SOURCE=199506L"
- libswanted="$libswanted pthread"
+ 11 | 12) # 12 may want upping the _POSIX_C_SOURCE datestamp...
+ ccflags=" -D_POSIX_C_SOURCE=199506L $ccflags"
+ set `echo X "$libswanted "| sed -e 's/ c / pthread c /'`
+ shift
+ libswanted="$*"
;;
esac
+ usemymalloc='n'
;;
esac
EOCBU
diff --git a/thread.h b/thread.h
index 695f288c4b..882158cdbb 100644
--- a/thread.h
+++ b/thread.h
@@ -136,12 +136,26 @@ struct perl_thread *getTHR _((void));
# endif
#endif
+#ifdef __hpux
+# define MUTEX_INIT_NEEDS_MUTEX_ZEROED
+#endif
+
#ifndef MUTEX_INIT
+#ifdef MUTEX_INIT_NEEDS_MUTEX_ZEROED
+ /* Temporary workaround, true bug is deeper. --jhi 1999-02-25 */
+#define MUTEX_INIT(m) \
+ STMT_START { \
+ Zero((m), 1, perl_mutex); \
+ if (pthread_mutex_init((m), pthread_mutexattr_default)) \
+ croak("panic: MUTEX_INIT"); \
+ } STMT_END
+#else
#define MUTEX_INIT(m) \
STMT_START { \
if (pthread_mutex_init((m), pthread_mutexattr_default)) \
croak("panic: MUTEX_INIT"); \
} STMT_END
+#endif
#define MUTEX_LOCK(m) \
STMT_START { \
if (pthread_mutex_lock((m))) \