Hans Leidekker : dnsapi: Remove the critical section around res_query.

Alexandre Julliard julliard at winehq.org
Wed Sep 8 13:32:13 CDT 2010


Module: wine
Branch: master
Commit: 18cd143086ef040f9322b0b9b017cb47a0a6946f
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=18cd143086ef040f9322b0b9b017cb47a0a6946f

Author: Hans Leidekker <hans at codeweavers.com>
Date:   Wed Sep  8 19:26:43 2010 +0200

dnsapi: Remove the critical section around res_query.

---

 dlls/dnsapi/query.c |   27 +--------------------------
 1 files changed, 1 insertions(+), 26 deletions(-)

diff --git a/dlls/dnsapi/query.c b/dlls/dnsapi/query.c
index 6014465..8de33e6 100644
--- a/dlls/dnsapi/query.c
+++ b/dlls/dnsapi/query.c
@@ -52,19 +52,6 @@ WINE_DEFAULT_DEBUG_CHANNEL(dnsapi);
 
 #ifdef HAVE_RESOLV
 
-static CRITICAL_SECTION resolver_cs;
-static CRITICAL_SECTION_DEBUG resolver_cs_debug =
-{
-    0, 0, &resolver_cs,
-    { &resolver_cs_debug.ProcessLocksList,
-      &resolver_cs_debug.ProcessLocksList },
-      0, 0, { (DWORD_PTR)(__FILE__ ": resolver_cs") }
-};
-static CRITICAL_SECTION resolver_cs = { &resolver_cs_debug, -1, 0, 0, 0, 0 };
-
-#define LOCK_RESOLVER()     do { EnterCriticalSection( &resolver_cs ); } while (0)
-#define UNLOCK_RESOLVER()   do { LeaveCriticalSection( &resolver_cs ); } while (0)
-
 /* call res_init() just once because of a bug in Mac OS X 10.4 */
 /* call once per thread on systems that have per-thread _res */
 static void initialise_resolver( void )
@@ -552,8 +539,7 @@ exit:
     return status;
 }
 
-/*  The resolver lock must be held and res_init() must have been
- *  called before calling these three functions.
+/* res_init() must have been called before calling these three functions.
  */
 static DNS_STATUS dns_set_serverlist( const IP4_ARRAY *addrs )
 {
@@ -704,16 +690,11 @@ DNS_STATUS WINAPI DnsQuery_UTF8( PCSTR name, WORD type, DWORD options, PVOID ser
     if (!name || !result)
         return ERROR_INVALID_PARAMETER;
 
-    LOCK_RESOLVER();
-
     initialise_resolver();
     _res.options |= dns_map_options( options );
 
     if (servers && (ret = dns_set_serverlist( servers )))
-    {
-        UNLOCK_RESOLVER();
         return ret;
-    }
 
     ret = dns_do_query( name, type, options, result );
 
@@ -724,8 +705,6 @@ DNS_STATUS WINAPI DnsQuery_UTF8( PCSTR name, WORD type, DWORD options, PVOID ser
         ret = dns_do_query_netbios( name, result );
     }
 
-    UNLOCK_RESOLVER();
-
 #endif
     return ret;
 }
@@ -822,12 +801,8 @@ DNS_STATUS WINAPI DnsQueryConfig( DNS_CONFIG_TYPE config, DWORD flag, PCWSTR ada
     case DnsConfigDnsServerList:
     {
 #ifdef HAVE_RESOLV
-        LOCK_RESOLVER();
-
         initialise_resolver();
         ret = dns_get_serverlist( buffer, len );
-
-        UNLOCK_RESOLVER();
         break;
 #else
         WARN( "compiled without resolver support\n" );




More information about the wine-cvs mailing list