This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Code(using pthreads) working in gcc2.96,NOT working in gcc3.2


On Tuesday 25 March 2003 10:30, Mihnea Balta wrote:
> There are two errors :)
>
> First, you're declaring thread_ptr as a pointer which points to nowhere, so
> the pthread library writes the thread descriptor at a random memory
> address. Replace the declaration with:
>
> pthread_t thread_ptr;
>
> Then, when you create the thread, do:
>
> if (0 != pthread_create (thread_ptr, &attr, start_proc, NULL)){

Sorry, I meant "pthread_create(&thread_ptr, &attr, start_proc, NULL)".


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]