diff options
author | janekptacijarabaci <janekptacijarabaci@seznam.cz> | 2018-04-29 09:07:42 +0200 |
---|---|---|
committer | janekptacijarabaci <janekptacijarabaci@seznam.cz> | 2018-04-29 09:07:42 +0200 |
commit | aff03b0a67c41cf7af5df9c9eef715a8b27a2667 (patch) | |
tree | aa2909ae4718f81c83c8cfb68c1f5a23485b3173 /nsprpub/pr/src/pthreads/ptsynch.c | |
parent | bdb4ff581677ad1cd411b55a68c87534f9a64882 (diff) | |
parent | 11caf6ecb3cb8c84d2355a6c6e9580a290147e92 (diff) | |
download | UXP-aff03b0a67c41cf7af5df9c9eef715a8b27a2667.tar UXP-aff03b0a67c41cf7af5df9c9eef715a8b27a2667.tar.gz UXP-aff03b0a67c41cf7af5df9c9eef715a8b27a2667.tar.lz UXP-aff03b0a67c41cf7af5df9c9eef715a8b27a2667.tar.xz UXP-aff03b0a67c41cf7af5df9c9eef715a8b27a2667.zip |
Merge branch 'master' of https://github.com/MoonchildProductions/UXP into js_dom_performance-resource-timing_1
Diffstat (limited to 'nsprpub/pr/src/pthreads/ptsynch.c')
-rw-r--r-- | nsprpub/pr/src/pthreads/ptsynch.c | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/nsprpub/pr/src/pthreads/ptsynch.c b/nsprpub/pr/src/pthreads/ptsynch.c index a93b74795..251205336 100644 --- a/nsprpub/pr/src/pthreads/ptsynch.c +++ b/nsprpub/pr/src/pthreads/ptsynch.c @@ -23,6 +23,11 @@ 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) @@ -258,7 +263,12 @@ 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 */ @@ -1161,14 +1171,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 == 0) + if (rv == PT_TRYLOCK_SUCCESS) { PR_ASSERT(PR_FALSE == lock->locked); lock->locked = PR_TRUE; lock->owner = pthread_self(); } /* XXX set error code? */ - return (0 == rv) ? PR_SUCCESS : PR_FAILURE; + return (PT_TRYLOCK_SUCCESS == rv) ? PR_SUCCESS : PR_FAILURE; } /* PRP_TryLock */ PR_IMPLEMENT(PRCondVar*) PRP_NewNakedCondVar(void) |