2008/5/31 Hans Leidekker <hans(a)it.vu.nl>:
> Make resolving hostnames thread-safe.
>
> +/* critical section to protect non-reentrant gethostbyname() */
> +CRITICAL_SECTION cs_gethostbyname;
> +static CRITICAL_SECTION_DEBUG critsect_debug =
> +{
> + 0, 0, &cs_gethostbyname,
> + { &critsect_debug.ProcessLocksList, &critsect_debug.ProcessLocksList },
> + 0, 0, { (DWORD_PTR)(__FILE__ ": cs_gethostbyname") }
> +};
> +CRITICAL_SECTION cs_gethostbyname = { &critsect_debug, -1, 0, 0, 0, 0 };
cs_gethostbyname should be static.
--
Rob Shearman