summaryrefslogtreecommitdiff
path: root/lib/libpthread
diff options
context:
space:
mode:
authorDavid Leonard <d@cvs.openbsd.org>1998-12-18 05:59:19 +0000
committerDavid Leonard <d@cvs.openbsd.org>1998-12-18 05:59:19 +0000
commit771cd4d45afd115c066de4b2682205453eac6929 (patch)
treee2ae5cb642c37fae767bd3a272e68c5a19df7cfa /lib/libpthread
parente5f6128f61a9a572c57cf04778f5616489f2e752 (diff)
add md _atomic_is_locked; clean
Diffstat (limited to 'lib/libpthread')
-rw-r--r--lib/libpthread/arch/alpha/_atomic_lock.c13
-rw-r--r--lib/libpthread/arch/i386/_atomic_lock.c11
-rw-r--r--lib/libpthread/arch/m68k/_atomic_lock.c10
-rw-r--r--lib/libpthread/arch/mips/_atomic_lock.c10
-rw-r--r--lib/libpthread/arch/sparc/_atomic_lock.c13
5 files changed, 49 insertions, 8 deletions
diff --git a/lib/libpthread/arch/alpha/_atomic_lock.c b/lib/libpthread/arch/alpha/_atomic_lock.c
index 74575fc11d7..b12bc32d94a 100644
--- a/lib/libpthread/arch/alpha/_atomic_lock.c
+++ b/lib/libpthread/arch/alpha/_atomic_lock.c
@@ -1,5 +1,7 @@
-/* $OpenBSD: _atomic_lock.c,v 1.1 1998/11/20 11:15:35 d Exp $ */
-/* Atomic lock for alpha */
+/* $OpenBSD: _atomic_lock.c,v 1.2 1998/12/18 05:59:17 d Exp $ */
+/*
+ * Atomic lock for alpha
+ */
#include "spinlock.h"
@@ -31,3 +33,10 @@ _atomic_lock(volatile register_t * lock)
return old;
}
+
+int
+_atomic_is_locked(volatile register_t * lock)
+{
+
+ return *lock;
+}
diff --git a/lib/libpthread/arch/i386/_atomic_lock.c b/lib/libpthread/arch/i386/_atomic_lock.c
index 609dc42fb01..8ddcb33068e 100644
--- a/lib/libpthread/arch/i386/_atomic_lock.c
+++ b/lib/libpthread/arch/i386/_atomic_lock.c
@@ -1,6 +1,6 @@
-/* $OpenBSD: _atomic_lock.c,v 1.1 1998/11/20 11:15:36 d Exp $ */
+/* $OpenBSD: _atomic_lock.c,v 1.2 1998/12/18 05:59:17 d Exp $ */
/*
- * Atomic lock aquire for i386.
+ * Atomic lock for i386
*/
#include "spinlock.h"
@@ -24,3 +24,10 @@ _atomic_lock(volatile register_t *lock)
*/
return old;
}
+
+int
+_atomic_is_locked(volatile register_t *lock)
+{
+
+ return *lock;
+}
diff --git a/lib/libpthread/arch/m68k/_atomic_lock.c b/lib/libpthread/arch/m68k/_atomic_lock.c
index be874ad2892..d0e2ddbe2d6 100644
--- a/lib/libpthread/arch/m68k/_atomic_lock.c
+++ b/lib/libpthread/arch/m68k/_atomic_lock.c
@@ -1,7 +1,8 @@
-/* $OpenBSD: _atomic_lock.c,v 1.1 1998/11/20 11:15:36 d Exp $ */
+/* $OpenBSD: _atomic_lock.c,v 1.2 1998/12/18 05:59:17 d Exp $ */
/*
* Atomic lock for m68k
*/
+
#include "spinlock.h"
register_t
@@ -25,3 +26,10 @@ _atomic_lock(volatile register_t *lock)
: "d"(1), "0"(old));
return old;
}
+
+int
+_atomic_lock(volatile register_t *lock)
+{
+
+ return *lock;
+}
diff --git a/lib/libpthread/arch/mips/_atomic_lock.c b/lib/libpthread/arch/mips/_atomic_lock.c
index 088d4a7a643..4df2a99ad85 100644
--- a/lib/libpthread/arch/mips/_atomic_lock.c
+++ b/lib/libpthread/arch/mips/_atomic_lock.c
@@ -1,7 +1,8 @@
-/* $OpenBSD: _atomic_lock.c,v 1.1 1998/11/20 11:15:37 d Exp $ */
+/* $OpenBSD: _atomic_lock.c,v 1.2 1998/12/18 05:59:18 d Exp $ */
/*
* Atomic lock for mips
*/
+
#include "pthread_private.h"
#include "spinlock.h"
#include <signal.h>
@@ -49,3 +50,10 @@ _atomic_lock(volatile register_t *lock)
#endif
return old;
}
+
+int
+_atomic_is_locked(volatile register_t * lock)
+{
+
+ return *lock;
+}
diff --git a/lib/libpthread/arch/sparc/_atomic_lock.c b/lib/libpthread/arch/sparc/_atomic_lock.c
index 35b50e3ada5..530c86b4805 100644
--- a/lib/libpthread/arch/sparc/_atomic_lock.c
+++ b/lib/libpthread/arch/sparc/_atomic_lock.c
@@ -1,5 +1,7 @@
-/* $OpenBSD */
-/* atomic lock for sparc */
+/* $OpenBSD: _atomic_lock.c,v 1.2 1998/12/18 05:59:18 d Exp $ */
+/*
+ * Atomic lock for sparc
+ */
#include "spinlock.h"
@@ -8,3 +10,10 @@ _atomic_lock(volatile register_t * lock)
{
return _thread_slow_atomic_lock(lock);
}
+
+int
+_atomic_is_locked(volatile register_t * lock)
+{
+
+ return *lock;
+}