summaryrefslogtreecommitdiffstats
path: root/nsprpub/pr/src/pthreads/ptsynch.c
diff options
context:
space:
mode:
authorwolfbeast <mcwerewolf@gmail.com>2018-02-23 11:03:38 +0100
committerwolfbeast <mcwerewolf@gmail.com>2018-06-05 22:23:36 +0200
commit75b3dd4cbffb6e4534128278300ed6c8a3ab7506 (patch)
treec09fcfbd7a6a3aa67c970934c09b087e7950d83f /nsprpub/pr/src/pthreads/ptsynch.c
parenta421f38160599152cd409e4fabd434a224f78487 (diff)
downloadUXP-75b3dd4cbffb6e4534128278300ed6c8a3ab7506.tar
UXP-75b3dd4cbffb6e4534128278300ed6c8a3ab7506.tar.gz
UXP-75b3dd4cbffb6e4534128278300ed6c8a3ab7506.tar.lz
UXP-75b3dd4cbffb6e4534128278300ed6c8a3ab7506.tar.xz
UXP-75b3dd4cbffb6e4534128278300ed6c8a3ab7506.zip
Update NSPR to 4.18
Diffstat (limited to 'nsprpub/pr/src/pthreads/ptsynch.c')
-rw-r--r--nsprpub/pr/src/pthreads/ptsynch.c14
1 files changed, 2 insertions, 12 deletions
diff --git a/nsprpub/pr/src/pthreads/ptsynch.c b/nsprpub/pr/src/pthreads/ptsynch.c
index 251205336..a93b74795 100644
--- a/nsprpub/pr/src/pthreads/ptsynch.c
+++ b/nsprpub/pr/src/pthreads/ptsynch.c
@@ -23,11 +23,6 @@ static pthread_condattr_t _pt_cvar_attr;
#if defined(DEBUG)
extern PTDebug pt_debug; /* this is shared between several modules */
-
-#if defined(_PR_DCETHREADS)
-static pthread_t pt_zero_tid; /* a null pthread_t (pthread_t is a struct
- * in DCE threads) to compare with */
-#endif /* defined(_PR_DCETHREADS) */
#endif /* defined(DEBUG) */
#if defined(FREEBSD)
@@ -263,12 +258,7 @@ static PRIntn pt_TimedWait(
rv = pthread_cond_timedwait(cv, ml, &tmo);
/* NSPR doesn't report timeouts */
-#ifdef _PR_DCETHREADS
- if (rv == -1) return (errno == EAGAIN) ? 0 : errno;
- else return rv;
-#else
return (rv == ETIMEDOUT) ? 0 : rv;
-#endif
} /* pt_TimedWait */
@@ -1171,14 +1161,14 @@ PR_IMPLEMENT(PRStatus) PR_DeleteSemaphore(const char *name)
PR_IMPLEMENT(PRStatus) PRP_TryLock(PRLock *lock)
{
PRIntn rv = pthread_mutex_trylock(&lock->mutex);
- if (rv == PT_TRYLOCK_SUCCESS)
+ if (rv == 0)
{
PR_ASSERT(PR_FALSE == lock->locked);
lock->locked = PR_TRUE;
lock->owner = pthread_self();
}
/* XXX set error code? */
- return (PT_TRYLOCK_SUCCESS == rv) ? PR_SUCCESS : PR_FAILURE;
+ return (0 == rv) ? PR_SUCCESS : PR_FAILURE;
} /* PRP_TryLock */
PR_IMPLEMENT(PRCondVar*) PRP_NewNakedCondVar(void)