From 7aa6c12a4424d00ea0add0a849f8a5b31a2de6a1 Mon Sep 17 00:00:00 2001 From: David Sommerseth Date: Sat, 28 Aug 2010 20:14:36 +0200 Subject: Clean-up: Remove pthread and mutex locking code This code was not activated at all, and hard coded as disabled in syshead.h with this code snippet: /* * Pthread support is currently experimental (and quite unfinished). */ #if 1 /* JYFIXME -- if defined, disable pthread */ #undef USE_PTHREAD #endif So no matter if --enable-pthread when running ./configure or not, this feature was never enabled in reality. Further, by removing the blocker code above made OpenVPN uncompilable in the current state. As the threading part needs to be completely rewritten and pthreading will not be supported in OpenVPN 2.x, removing this code seems most reasonable. In addition, a lot of mutex locking code was also removed, as they were practically NOP functions, due to pthreading being forcefully disabled Signed-off-by: David Sommerseth Acked-by: James Yonan --- socket.c | 7 ------- 1 file changed, 7 deletions(-) (limited to 'socket.c') diff --git a/socket.c b/socket.c index 7d20bb0..d330558 100644 --- a/socket.c +++ b/socket.c @@ -26,7 +26,6 @@ #include "socket.h" #include "fdmisc.h" -#include "thread.h" #include "misc.h" #include "gremlin.h" #include "plugin.h" @@ -1933,10 +1932,8 @@ print_sockaddr_ex (const struct openvpn_sockaddr *addr, struct buffer out = alloc_buf_gc (64, gc); const int port = ntohs (addr->sa.sin_port); - mutex_lock_static (L_INET_NTOA); if (!(flags & PS_DONT_SHOW_ADDR)) buf_printf (&out, "%s", (addr_defined (addr) ? inet_ntoa (addr->sa.sin_addr) : "[undef]")); - mutex_unlock_static (L_INET_NTOA); if (((flags & PS_SHOW_PORT) || (addr_defined (addr) && (flags & PS_SHOW_PORT_IF_DEFINED))) && port) @@ -1998,9 +1995,7 @@ print_in_addr_t (in_addr_t addr, unsigned int flags, struct gc_arena *gc) CLEAR (ia); ia.s_addr = (flags & IA_NET_ORDER) ? addr : htonl (addr); - mutex_lock_static (L_INET_NTOA); buf_printf (&out, "%s", inet_ntoa (ia)); - mutex_unlock_static (L_INET_NTOA); } return BSTR (&out); } @@ -2016,9 +2011,7 @@ setenv_sockaddr (struct env_set *es, const char *name_prefix, const struct openv else openvpn_snprintf (name_buf, sizeof (name_buf), "%s", name_prefix); - mutex_lock_static (L_INET_NTOA); setenv_str (es, name_buf, inet_ntoa (addr->sa.sin_addr)); - mutex_unlock_static (L_INET_NTOA); if ((flags & SA_IP_PORT) && addr->sa.sin_port) { -- cgit v1.2.3