pkgsrc/devel/pwlib/patches/patch-al
joerg 928b9af7ea Fix up pthread related source:
- PTHREAD_MUTEX_RECURSIVE is POSIX, _NP doesn't exist
- try to link when looking for pthread_mutex_timedlock
- don't hard-code -lpthread

Bump revision, since the generated library changed.
2006-05-16 15:56:43 +00:00

42 lines
1.3 KiB
Text

$NetBSD: patch-al,v 1.4 2006/05/16 15:56:43 joerg Exp $
--- src/ptlib/unix/tlibthrd.cxx.orig 2004-09-02 07:55:44.000000000 +0000
+++ src/ptlib/unix/tlibthrd.cxx
@@ -1088,7 +1088,9 @@ void PThread::Sleep(const PTimeInterval
if (select(0, NULL, NULL, NULL, tval) < 0 && errno != EINTR)
break;
+#ifndef P_NETBSD
pthread_testcancel();
+#endif
lastTime = PTime();
}
@@ -1587,17 +1589,13 @@ BOOL PSemaphore::WillBlock() const
#endif
}
-#if defined(P_QNX) && (P_HAS_RECURSIVE_MUTEX == 1)
-#define PTHREAD_MUTEX_RECURSIVE_NP PTHREAD_MUTEX_RECURSIVE
-#endif
-
PMutex::PMutex()
: PSemaphore(PXMutex)
{
#if P_HAS_RECURSIVE_MUTEX
pthread_mutexattr_t attr;
pthread_mutexattr_init(&attr);
- pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE_NP);
+ pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE);
pthread_mutex_init(&mutex, &attr);
#else
ownerThreadId = (pthread_t)-1;
@@ -1610,7 +1608,7 @@ PMutex::PMutex(const PMutex & /*mut*/)
#if P_HAS_RECURSIVE_MUTEX
pthread_mutexattr_t attr;
pthread_mutexattr_init(&attr);
- pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE_NP);
+ pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE);
pthread_mutex_init(&mutex, &attr);
#else
ownerThreadId = (pthread_t)-1;