Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 05 Oct 2001 01:32:19 -0700
From:      Terry Lambert <tlambert2@mindspring.com>
To:        Oleg Golovanov <olmi@home.krasnoyarsk.ru>
Cc:        freebsd-questions@freebsd.org, freebsd-hackers@freebsd.org
Subject:   Re: Question about pthread
Message-ID:  <3BBD7013.997C025B@mindspring.com>
References:  <3BBB77A7.5C4B129E@home.krasnoyarsk.ru>

next in thread | previous in thread | raw e-mail | index | archive | help
Oleg Golovanov wrote:
> 
> Dear Sirs:
> 
> I am using FreeBSD-2.2.8 and after calling pthread_create()
> my programs get sigfault (SIGSEGV) and exited with core dump.
> 
> I should like to ask if somebody know the solve of this problem.
> My example of using pthread is included below.
> 
> I ask to answer me directly on my e-mail.

[ ... ]

>     pthread_create(NULL, NULL, &coms, confd);

2.2.8 is a pre draft 4 standard pthreads implementation.

	void
	coms( void *confdp)
	{
		int confd = *(int *)confdp;
		...
	}


	main()
	{
		pthread_t	id;	/* REQUIRED */

		...
		/* Note: "coms", _NOT_ "&coms"... */
		pthread_create( &id, NULL, coms, (void *)&confd);
		...
	}

-- Terry

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-hackers" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?3BBD7013.997C025B>