summaryrefslogtreecommitdiffstats
path: root/lib/libc/net/name6.c
diff options
context:
space:
mode:
authordeischen <deischen@FreeBSD.org>2003-05-04 22:36:46 +0000
committerdeischen <deischen@FreeBSD.org>2003-05-04 22:36:46 +0000
commitb9459b93990457e57a289323e1cab3e685ea9b5c (patch)
tree99ec35f5218201f02e7544eff495375f8ad8cd14 /lib/libc/net/name6.c
parent3cb9ba9e43902d7a4cf096e0b6cd3f12eda1b92c (diff)
downloadFreeBSD-src-b9459b93990457e57a289323e1cab3e685ea9b5c.zip
FreeBSD-src-b9459b93990457e57a289323e1cab3e685ea9b5c.tar.gz
Replace use of a spinlock with a mutex.
Diffstat (limited to 'lib/libc/net/name6.c')
-rw-r--r--lib/libc/net/name6.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/lib/libc/net/name6.c b/lib/libc/net/name6.c
index 3326cdf..b1a4953 100644
--- a/lib/libc/net/name6.c
+++ b/lib/libc/net/name6.c
@@ -114,6 +114,7 @@ __FBSDID("$FreeBSD$");
#include <string.h>
#include <stdarg.h>
#include <nsswitch.h>
+#include <pthread.h>
#include <unistd.h>
#include "un-namespace.h"
@@ -189,20 +190,18 @@ static void _dns_ehent(void) __unused;
static int _icmp_ghbyaddr(void *, void *, va_list);
#endif /* ICMPNL */
-/* Make getipnodeby*() thread-safe in libc for use with kernel threads. */
-#include "libc_private.h"
-#include "spinlock.h"
/*
* XXX: Our res_*() is not thread-safe. So, we share lock between
* getaddrinfo() and getipnodeby*(). Still, we cannot use
* getaddrinfo() and getipnodeby*() in conjunction with other
* functions which call res_*().
*/
-extern spinlock_t __getaddrinfo_thread_lock;
+#include "libc_private.h"
+extern pthread_mutex_t __getaddrinfo_thread_lock;
#define THREAD_LOCK() \
- if (__isthreaded) _SPINLOCK(&__getaddrinfo_thread_lock);
+ if (__isthreaded) _pthread_mutex_lock(&__getaddrinfo_thread_lock);
#define THREAD_UNLOCK() \
- if (__isthreaded) _SPINUNLOCK(&__getaddrinfo_thread_lock);
+ if (__isthreaded) _pthread_mutex_unlock(&__getaddrinfo_thread_lock);
/* Host lookup order if nsswitch.conf is broken or nonexistant */
static const ns_src default_src[] = {
OpenPOWER on IntegriCloud