|
From: Igmar P. <mai...@jd...> - 2006-09-04 06:28:20
|
> > int main()
> > {
> > pthread_t tid;
> >
> > if (0 == pthread_create(&tid, NULL, thread1, 0))
> > pthread_join(tid, 0);
> >
> > return 0;
> > }
> Could you tell me what the bug is?
The first argument to pthread_create is a pointer to a pthread_t, not the
pthread itself.
> I cannot think of anything wrong with my code.
> "gcc -g -o test_thread test_thread.c -Wall -lpthrad" doesn't
> show any warnings.
Remove the typecast :
xx.c:15: warning: passing arg 1 of `pthread_create' makes pointer from
integer without a cast
Igmar
|