pkgsrc/devel/nspr/patches/patch-ak
bjs 0400b542c1 Update to version 4.6.7 (bugfix release). See new patches
for more information about them.  While here, fix pkglint warnings.

ok'd by joerg@
2007-09-25 04:18:25 +00:00

51 lines
1.7 KiB
Text

$NetBSD: patch-ak,v 1.1 2007/09/25 04:18:27 bjs Exp $
--- pr/src/pthreads/ptsynch.c.orig 2004-11-22 16:24:53.000000000 -0500
+++ pr/src/pthreads/ptsynch.c
@@ -62,7 +62,7 @@ static pthread_t pt_zero_tid; /* a null
#endif /* defined(_PR_DCETHREADS) */
#endif /* defined(DEBUG) */
-#if defined(FREEBSD)
+#if defined(FREEBSD) && (defined(DEBUG) || defined(FORCE_PR_ASSERT))
/*
* On older versions of FreeBSD, pthread_mutex_trylock returns EDEADLK.
* Newer versions return EBUSY. We still need to support both.
@@ -342,7 +342,10 @@ PR_IMPLEMENT(PRCondVar*) PR_NewCondVar(P
PR_ASSERT(lock != NULL);
if (cv != NULL)
{
- int rv = _PT_PTHREAD_COND_INIT(cv->cv, _pt_cvar_attr);
+#if defined(DEBUG) || defined(FORCE_PR_ASSERT)
+ int rv =
+#endif
+ _PT_PTHREAD_COND_INIT(cv->cv, _pt_cvar_attr);
PR_ASSERT(0 == rv);
cv->lock = lock;
cv->notify_pending = 0;
@@ -357,7 +360,11 @@ PR_IMPLEMENT(void) PR_DestroyCondVar(PRC
{
if (0 > PR_AtomicDecrement(&cvar->notify_pending))
{
- PRIntn rv = pthread_cond_destroy(&cvar->cv); PR_ASSERT(0 == rv);
+#if defined(DEBUG) || defined(FORCE_PR_ASSERT)
+ PRIntn rv =
+#endif
+ pthread_cond_destroy(&cvar->cv);
+ PR_ASSERT(0 == rv);
#if defined(DEBUG)
memset(cvar, 0xaf, sizeof(PRCondVar));
pt_debug.cvars_destroyed += 1;
@@ -1079,8 +1086,11 @@ PR_IMPLEMENT(PRCondVar*) PRP_NewNakedCon
cv = PR_NEW(PRCondVar);
if (cv != NULL)
{
+#if defined(DEBUG) || defined(FORCE_PR_ASSERT)
int rv;
- rv = _PT_PTHREAD_COND_INIT(cv->cv, _pt_cvar_attr);
+ rv =
+#endif
+ _PT_PTHREAD_COND_INIT(cv->cv, _pt_cvar_attr);
PR_ASSERT(0 == rv);
cv->lock = _PR_NAKED_CV_LOCK;
}