summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorwtc%netscape.com <devnull@localhost>1999-10-22 01:10:00 +0000
committerwtc%netscape.com <devnull@localhost>1999-10-22 01:10:00 +0000
commit4e31cc9685d0bcc29e192c4234d8252df47a6ec4 (patch)
tree4c9e795a2cbb4c05fb32bde35f86ac4a3fdd8cb5
parent4ada32144e9afaf60ecff3ca47000dcd2a4a27e9 (diff)
downloadnspr-hg-4e31cc9685d0bcc29e192c4234d8252df47a6ec4.tar.gz
Bugsplat bug #366500: use the default, PRLock-based atomic stack
implementation on OSF1. r=larryh,srinivas@netscape.com. Modified files: _osf1.h, osf1.c.
-rw-r--r--pr/include/md/_osf1.h1
-rw-r--r--pr/src/md/unix/osf1.c57
2 files changed, 0 insertions, 58 deletions
diff --git a/pr/include/md/_osf1.h b/pr/include/md/_osf1.h
index 7947ec61..96a2fe22 100644
--- a/pr/include/md/_osf1.h
+++ b/pr/include/md/_osf1.h
@@ -205,7 +205,6 @@ extern int __poll(struct pollfd filedes[], unsigned int nfds, int timeout);
#ifdef OSF1_HAVE_MACHINE_BUILTINS_H
#include <machine/builtins.h>
#define _PR_HAVE_ATOMIC_OPS
-#define _PR_HAVE_ATOMIC_CAS
#define _MD_INIT_ATOMIC()
#define _MD_ATOMIC_INCREMENT(val) (__ATOMIC_INCREMENT_LONG(val) + 1)
#define _MD_ATOMIC_ADD(ptr, val) (__ATOMIC_ADD_LONG(ptr, val) + val)
diff --git a/pr/src/md/unix/osf1.c b/pr/src/md/unix/osf1.c
index bb3f9b5b..70c8dd87 100644
--- a/pr/src/md/unix/osf1.c
+++ b/pr/src/md/unix/osf1.c
@@ -86,60 +86,3 @@ _MD_CREATE_THREAD(
return PR_FAILURE;
}
#endif /* ! _PR_PTHREADS */
-
-#ifdef _PR_HAVE_ATOMIC_CAS
-
-#include <c_asm.h>
-
-#define _PR_OSF_ATOMIC_LOCK 1
-
-void
-PR_StackPush(PRStack *stack, PRStackElem *stack_elem)
-{
-long locked;
-
- do {
- while ((long) stack->prstk_head.prstk_elem_next ==
- _PR_OSF_ATOMIC_LOCK)
- ;
- locked = __ATOMIC_EXCH_QUAD(&stack->prstk_head.prstk_elem_next,
- _PR_OSF_ATOMIC_LOCK);
-
- } while (locked == _PR_OSF_ATOMIC_LOCK);
- stack_elem->prstk_elem_next = (PRStackElem *) locked;
- /*
- * memory-barrier instruction
- */
- asm("mb");
- stack->prstk_head.prstk_elem_next = stack_elem;
-}
-
-PRStackElem *
-PR_StackPop(PRStack *stack)
-{
-PRStackElem *element;
-long locked;
-
- do {
- while ((long)stack->prstk_head.prstk_elem_next == _PR_OSF_ATOMIC_LOCK)
- ;
- locked = __ATOMIC_EXCH_QUAD(&stack->prstk_head.prstk_elem_next,
- _PR_OSF_ATOMIC_LOCK);
-
- } while (locked == _PR_OSF_ATOMIC_LOCK);
-
- element = (PRStackElem *) locked;
-
- if (element == NULL) {
- stack->prstk_head.prstk_elem_next = NULL;
- } else {
- stack->prstk_head.prstk_elem_next =
- element->prstk_elem_next;
- }
- /*
- * memory-barrier instruction
- */
- asm("mb");
- return element;
-}
-#endif /* _PR_HAVE_ATOMIC_CAS */