summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorwtc%netscape.com <devnull@localhost>2001-06-24 05:10:37 +0000
committerwtc%netscape.com <devnull@localhost>2001-06-24 05:10:37 +0000
commit76f267689261abce31eca1d3c17778f5c6245488 (patch)
tree712748c1c435fac6e2808c6d426230fa55534e32
parente4c4022498bc05de5bea07c5388896ff89a6037f (diff)
downloadnspr-hg-76f267689261abce31eca1d3c17778f5c6245488.tar.gz
Bugzilla bug 81011: Changed the return type of _PR_MD_TEST_AND_LOCK from
PRBool to PRIntn and documented its meaning. Modifies files: _beos.h, _irix.h, _win16.h, _win95.h, primpl.h, os2cv.c.
-rw-r--r--pr/include/md/_beos.h2
-rw-r--r--pr/include/md/_irix.h2
-rw-r--r--pr/include/md/_win16.h2
-rw-r--r--pr/include/md/_win95.h2
-rw-r--r--pr/include/private/primpl.h3
-rw-r--r--pr/src/md/os2/os2cv.c4
6 files changed, 8 insertions, 7 deletions
diff --git a/pr/include/md/_beos.h b/pr/include/md/_beos.h
index 275ebb65..232fea3c 100644
--- a/pr/include/md/_beos.h
+++ b/pr/include/md/_beos.h
@@ -481,7 +481,7 @@ NSPR_API(void) _MD_init_locks(void);
NSPR_API(PRStatus) _MD_new_lock(struct _MDLock *md);
NSPR_API(void) _MD_free_lock(struct _MDLock *md);
NSPR_API(void) _MD_lock(struct _MDLock *md);
-NSPR_API(PRBool) _MD_test_and_lock(struct _MDLock *md);
+NSPR_API(PRIntn) _MD_test_and_lock(struct _MDLock *md);
NSPR_API(void) _MD_unlock(struct _MDLock *md);
NSPR_API(void) _MD_ioq_lock(void);
NSPR_API(void) _MD_ioq_unlock(void);
diff --git a/pr/include/md/_irix.h b/pr/include/md/_irix.h
index 1f73f1eb..09067002 100644
--- a/pr/include/md/_irix.h
+++ b/pr/include/md/_irix.h
@@ -240,7 +240,7 @@ NSPR_API(void) _MD_FREE_LOCK(struct _MDLock *lockp);
#define _MD_LOCK(_lockp) _PR_LOCK((_lockp)->lock)
#define _MD_UNLOCK(_lockp) _PR_UNLOCK((_lockp)->lock)
-#define _MD_TEST_AND_LOCK(_lockp) uscsetlock((_lockp)->lock, 1)
+#define _MD_TEST_AND_LOCK(_lockp) (uscsetlock((_lockp)->lock, 1) == 0)
extern ulock_t _pr_heapLock;
diff --git a/pr/include/md/_win16.h b/pr/include/md/_win16.h
index c5d457c0..147ef77a 100644
--- a/pr/include/md/_win16.h
+++ b/pr/include/md/_win16.h
@@ -377,7 +377,7 @@ extern PRStatus _PR_KillWindowsProcess(struct PRProcess *process);
#define _MD_NEW_LOCK(l) (PR_SUCCESS)
#define _MD_FREE_LOCK(l)
#define _MD_LOCK(l)
-#define _MD_TEST_AND_LOCK(l) (PR_FAILURE)
+#define _MD_TEST_AND_LOCK(l) (-1)
#define _MD_UNLOCK(l)
/* --- lock and cv waiting --- */
diff --git a/pr/include/md/_win95.h b/pr/include/md/_win95.h
index 1553d233..6a9bb271 100644
--- a/pr/include/md/_win95.h
+++ b/pr/include/md/_win95.h
@@ -339,7 +339,7 @@ extern PRInt32 _MD_Accept(PRFileDesc *fd, PRNetAddr *raddr, PRUint32 *rlen,
#define _MD_NEW_LOCK(lock) (InitializeCriticalSection(&((lock)->mutex)),(lock)->notified.length=0,(lock)->notified.link=NULL,PR_SUCCESS)
#define _MD_FREE_LOCK(lock) DeleteCriticalSection(&((lock)->mutex))
#define _MD_LOCK(lock) EnterCriticalSection(&((lock)->mutex))
-#define _MD_TEST_AND_LOCK(lock) (EnterCriticalSection(&((lock)->mutex)),PR_SUCCESS)
+#define _MD_TEST_AND_LOCK(lock) (EnterCriticalSection(&((lock)->mutex)),0)
#define _MD_UNLOCK _PR_MD_UNLOCK
/* --- lock and cv waiting --- */
diff --git a/pr/include/private/primpl.h b/pr/include/private/primpl.h
index 4da89053..eb1dd716 100644
--- a/pr/include/private/primpl.h
+++ b/pr/include/private/primpl.h
@@ -881,7 +881,8 @@ NSPR_API(void) _PR_MD_FREE_LOCK(_MDLock *md);
NSPR_API(void) _PR_MD_LOCK(_MDLock *md);
#define _PR_MD_LOCK _MD_LOCK
-NSPR_API(PRBool) _PR_MD_TEST_AND_LOCK(_MDLock *md);
+/* Return 0 on success, a nonzero value on failure. */
+NSPR_API(PRIntn) _PR_MD_TEST_AND_LOCK(_MDLock *md);
#define _PR_MD_TEST_AND_LOCK _MD_TEST_AND_LOCK
NSPR_API(void) _PR_MD_UNLOCK(_MDLock *md);
diff --git a/pr/src/md/os2/os2cv.c b/pr/src/md/os2/os2cv.c
index c513540f..30e40f9b 100644
--- a/pr/src/md/os2/os2cv.c
+++ b/pr/src/md/os2/os2cv.c
@@ -349,11 +349,11 @@ void _PR_MD_LOCK(_MDLock *lock)
DosRequestMutexSem(lock->mutex, SEM_INDEFINITE_WAIT);
}
-PRBool
+PRIntn
_PR_MD_TEST_AND_LOCK(_MDLock *lock)
{
DosRequestMutexSem(lock->mutex, SEM_INDEFINITE_WAIT);
- return PR_SUCCESS;
+ return 0;
}
void