Re: pthread bug...?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Thangababu_Pichaikani@satyam.com writes:

>   pthread_t tid1;
>   int a = 1;
>   pthread_create(NULL,NULL,thrfunc,NULL);

The Single Unix specification:

http://www.opengroup.org/onlinepubs/007908799/xsh/pthread_create.html

is not 100% precise on whether the first argument to
pthread_create(), `thread', cannot be NULL, but it says that
"Upon successful completion, pthread_create() stores the ID of
the created thread in the location referenced by `thread'."

And actually, substituting the last line of your program with the
following fixes your problem:

  pthread_create(&tid1,NULL,thrfunc,NULL);

See you.

-- 
Guillaume Cottenceau, MandrakeSoft
See you on Cooker! http://www.linux-mandrake.com/en/cookerdevel.php3



_______________________________________________
Redhat-devel-list mailing list
Redhat-devel-list@redhat.com
https://listman.redhat.com/mailman/listinfo/redhat-devel-list

[Index of Archives]     [Kernel Newbies]     [Red Hat General]     [Fedora]     [Red Hat Install]     [Linux Kernel Development]     [Yosemite News]

  Powered by Linux