Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2)

Unified Diff: nspr/pr/src/threads/combined/prulock.c

Issue 200653003: Update to NSPR 4.10.4. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/deps/third_party/nss/
Patch Set: Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « nspr/pr/src/threads/combined/prucv.c ('k') | nspr/pr/src/threads/prmon.c » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: nspr/pr/src/threads/combined/prulock.c
===================================================================
--- nspr/pr/src/threads/combined/prulock.c (revision 257452)
+++ nspr/pr/src/threads/combined/prulock.c (working copy)
@@ -160,16 +160,24 @@
lock = PR_NEWZAP(PRLock);
if (lock) {
- if (_PR_MD_NEW_LOCK(&lock->ilock) == PR_FAILURE) {
- PR_DELETE(lock);
- return(NULL);
- }
- PR_INIT_CLIST(&lock->links);
- PR_INIT_CLIST(&lock->waitQ);
+ if (_PR_InitLock(lock) != PR_SUCCESS) {
+ PR_DELETE(lock);
+ return NULL;
+ }
}
return lock;
}
+PRStatus _PR_InitLock(PRLock *lock)
+{
+ if (_PR_MD_NEW_LOCK(&lock->ilock) != PR_SUCCESS) {
+ return PR_FAILURE;
+ }
+ PR_INIT_CLIST(&lock->links);
+ PR_INIT_CLIST(&lock->waitQ);
+ return PR_SUCCESS;
+}
+
/*
** Destroy the given lock "lock". There is no point in making this race
** free because if some other thread has the pointer to this lock all
@@ -177,11 +185,16 @@
*/
PR_IMPLEMENT(void) PR_DestroyLock(PRLock *lock)
{
- PR_ASSERT(lock->owner == 0);
- _PR_MD_FREE_LOCK(&lock->ilock);
+ _PR_FreeLock(lock);
PR_DELETE(lock);
}
+void _PR_FreeLock(PRLock *lock)
+{
+ PR_ASSERT(lock->owner == 0);
+ _PR_MD_FREE_LOCK(&lock->ilock);
+}
+
extern PRThread *suspendAllThread;
/*
** Lock the lock.
« no previous file with comments | « nspr/pr/src/threads/combined/prucv.c ('k') | nspr/pr/src/threads/prmon.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698