This is the mail archive of the
cygwin
mailing list for the Cygwin project.
Re: pthreads and sockets - Cannot register window class error
- From: Christopher Faylor <cgf-no-personal-reply-please at cygwin dot com>
- To: cygwin at cygwin dot com
- Date: Wed, 5 May 2004 17:03:40 -0400
- Subject: Re: pthreads and sockets - Cannot register window class error
- References: <4098760F.CDB4F630@hot.pl> <4098E04B.34D2866B@dessent.net>
- Reply-to: cygwin at cygwin dot com
On Wed, May 05, 2004 at 05:38:35AM -0700, Brian Dessent wrote:
>Jacek Trzmiel wrote:
>
>> void test()
>> {
>> /* go find out about the desired host machine */
>> struct hostent *he = gethostbyname(HOST);
>> if (he == 0) {
>> perror("gethostbyname");
>> exit(1);
>> }
>
>Just a wild guess, but gethostbyname() is probably not reentrant and
>can't be called from threads like that.
Unless HOST is a numeric IP address, gethostbyname should be properly
reentrant. The only time gethostbyname is not thread safe is when it is
resolving a numeric IP.
cgf
--
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Problem reports: http://cygwin.com/problems.html
Documentation: http://cygwin.com/docs.html
FAQ: http://cygwin.com/faq/