summaryrefslogtreecommitdiffstats
path: root/contrib/gdtoa
diff options
context:
space:
mode:
authordas <das@FreeBSD.org>2003-06-21 08:20:14 +0000
committerdas <das@FreeBSD.org>2003-06-21 08:20:14 +0000
commit502b55c20b019782171fd4c6c6351ec958baccc6 (patch)
treed851717b2c4ca09e2801c78aeea0be4bbd432fdb /contrib/gdtoa
parentd6a3dc0a5923a623809d7bf9f60513fcfcbe0111 (diff)
downloadFreeBSD-src-502b55c20b019782171fd4c6c6351ec958baccc6.zip
FreeBSD-src-502b55c20b019782171fd4c6c6351ec958baccc6.tar.gz
Userland spinlocks bad. Sleep locks good.
Use the latter for gdtoa. Requested by: deischen (far too long ago)
Diffstat (limited to 'contrib/gdtoa')
-rw-r--r--contrib/gdtoa/gdtoaimp.h19
1 files changed, 11 insertions, 8 deletions
diff --git a/contrib/gdtoa/gdtoaimp.h b/contrib/gdtoa/gdtoaimp.h
index 3048656..0c4a936 100644
--- a/contrib/gdtoa/gdtoaimp.h
+++ b/contrib/gdtoa/gdtoaimp.h
@@ -188,7 +188,10 @@ THIS SOFTWARE.
#include "stdlib.h"
#include "string.h"
#include "libc_private.h"
-#include "spinlock.h"
+
+#include "namespace.h"
+#include <pthread.h>
+#include "un-namespace.h"
#ifdef KR_headers
#define Char char
@@ -465,14 +468,14 @@ extern double rnd_prod(double, double), rnd_quot(double, double);
#endif
#define MULTIPLE_THREADS
-extern spinlock_t __gdtoa_locks[2];
-#define ACQUIRE_DTOA_LOCK(n) do { \
- if (__isthreaded) \
- _SPINLOCK(&__gdtoa_locks[n]); \
+extern pthread_mutex_t __gdtoa_locks[2];
+#define ACQUIRE_DTOA_LOCK(n) do { \
+ if (__isthreaded) \
+ _pthread_mutex_lock(&__gdtoa_locks[n]); \
} while(0)
-#define FREE_DTOA_LOCK(n) do { \
- if (__isthreaded) \
- _SPINUNLOCK(&__gdtoa_locks[n]); \
+#define FREE_DTOA_LOCK(n) do { \
+ if (__isthreaded) \
+ _pthread_mutex_unlock(&__gdtoa_locks[n]); \
} while(0)
#define Kmax 15
OpenPOWER on IntegriCloud