diff options
author | Hajimu UMEMOTO <ume@FreeBSD.org> | 2005-04-15 18:15:12 +0000 |
---|---|---|
committer | Hajimu UMEMOTO <ume@FreeBSD.org> | 2005-04-15 18:15:12 +0000 |
commit | 62e8b17d72e99920decb22e1c87bfd8a2f789b82 (patch) | |
tree | 66fcd4ab2500e22a753a79200fe36c3296f27f1c /lib/libc | |
parent | 96f79dca7680fa814d77b3a580136360e573ea66 (diff) | |
download | src-62e8b17d72e99920decb22e1c87bfd8a2f789b82.tar.gz src-62e8b17d72e99920decb22e1c87bfd8a2f789b82.zip |
Now, our getservbyname(3) is thread-safe. So, we don't need
to protect it with mutex lock.
Notes
Notes:
svn path=/head/; revision=145118
Diffstat (limited to 'lib/libc')
-rw-r--r-- | lib/libc/net/getaddrinfo.c | 15 |
1 files changed, 1 insertions, 14 deletions
diff --git a/lib/libc/net/getaddrinfo.c b/lib/libc/net/getaddrinfo.c index 8e7f566d37a5..0265dd673ae0 100644 --- a/lib/libc/net/getaddrinfo.c +++ b/lib/libc/net/getaddrinfo.c @@ -66,7 +66,6 @@ __FBSDID("$FreeBSD$"); #include "namespace.h" -#include "reentrant.h" #include <sys/types.h> #include <sys/param.h> #include <sys/socket.h> @@ -286,14 +285,6 @@ static int res_searchN(const char *, struct res_target *); static int res_querydomainN(const char *, const char *, struct res_target *); -/* - * XXX: Many dependencies are not thread-safe. Still, we cannot use - * getaddrinfo() in conjunction with other functions which call them. - */ -static mutex_t _getaddrinfo_thread_lock = MUTEX_INITIALIZER; -#define THREAD_LOCK() mutex_lock(&_getaddrinfo_thread_lock); -#define THREAD_UNLOCK() mutex_unlock(&_getaddrinfo_thread_lock); - /* XXX macros that make external reference is BAD. */ #define GET_AI(ai, afd, addr) \ @@ -1441,13 +1432,9 @@ get_port(ai, servname, matchonly) break; } - THREAD_LOCK(); - if ((sp = getservbyname(servname, proto)) == NULL) { - THREAD_UNLOCK(); + if ((sp = getservbyname(servname, proto)) == NULL) return EAI_SERVICE; - } port = sp->s_port; - THREAD_UNLOCK(); } if (!matchonly) { |