]> granicus.if.org Git - curl/commitdiff
onstantine Sapuntzakis threaded resolver enhancements
authorYang Tse <yangsita@gmail.com>
Tue, 26 Jan 2010 08:43:21 +0000 (08:43 +0000)
committerYang Tse <yangsita@gmail.com>
Tue, 26 Jan 2010 08:43:21 +0000 (08:43 +0000)
lib/hostthre.c
lib/setup.h

index 2205c8fddbb551f2905f03638abf83720155acd3..9772351c1454a8eb8ef21a6621b03ec667dc063e 100644 (file)
 /* The last #include file should be: */
 #include "memdebug.h"
 
-#if defined(_MSC_VER) && defined(CURL_NO__BEGINTHREADEX)
-#pragma message ("No _beginthreadex() available in this RTL")
-#endif
-
 /***********************************************************************
  * Only for threaded name resolves builds
  **********************************************************************/
index 980a91699a2ea29dcb33ea8e444f6467d4245cfa..ced3face5f11060e8135f3cfdf26df1946cfa7ef 100644 (file)
 /*         CURLRES_* defines to use in the host*.c sources          */
 /* ---------------------------------------------------------------- */
 
-#if defined(WIN32) && !defined(__CYGWIN__) && !defined(USE_ARES) && \
-    !defined(__LCC__)  /* lcc-win32 doesn't have _beginthreadex() */
-#ifdef ENABLE_IPV6
-#define USE_THREADING_GETADDRINFO
-#else
-#define USE_THREADING_GETHOSTBYNAME  /* Cygwin uses alarm() function */
-#endif
+/*
+ * lcc-win32 doesn't have _beginthreadex(), lacks threads support.
+ */
+
+#if defined(__LCC__) && defined(WIN32)
+#  undef USE_THREADS_POSIX
+#  undef USE_THREADS_WIN32
 #endif
 
-/* "cl -ML" or "cl -MLd" implies a single-threaded runtime library where
-   _beginthreadex() is not available */
-#if (defined(_MSC_VER) && !defined(__POCC__)) && !defined(_MT) && !defined(USE_ARES)
-#undef USE_THREADING_GETADDRINFO
-#undef USE_THREADING_GETHOSTBYNAME
-#define CURL_NO__BEGINTHREADEX
+/*
+ * MSVC threads support requires a multi-threaded runtime library.
+ * _beginthreadex() is not available in single-threaded ones.
+ */
+
+#if defined(_MSC_VER) && !defined(__POCC__) && !defined(_MT)
+#  undef USE_THREADS_POSIX
+#  undef USE_THREADS_WIN32
 #endif
 
+/*
+ * Mutually exclusive CURLRES_* definitions.
+ */
+
 #ifdef USE_ARES
 #  define CURLRES_ASYNCH
 #  define CURLRES_ARES
-#endif
-
-#ifdef USE_THREADING_GETHOSTBYNAME
-#  define CURLRES_ASYNCH
-#  define CURLRES_THREADED
-#endif
-
-#ifdef USE_THREADING_GETADDRINFO
+#elif defined(USE_THREADS_POSIX) || defined(USE_THREADS_WIN32)
 #  define CURLRES_ASYNCH
 #  define CURLRES_THREADED
+#else
+#  define CURLRES_SYNCH
 #endif
 
 #ifdef ENABLE_IPV6
 #  define CURLRES_IPV4
 #endif
 
-#ifndef CURLRES_ASYNCH
-#  define CURLRES_SYNCH
-#endif
-
 /* ---------------------------------------------------------------- */
 
 /*