Re: strange problems with pthreads

From: Ulrich Eckhardt (doomster_at_knuut.de)
Date: 02/21/04


Date: Sat, 21 Feb 2004 13:47:14 +0100

Chris Friesen wrote:
> pthread_t t1;
>
> void *func(void *p)
> {
[...]
> int schedRc = pthread_setschedparam(t1, policy, &schedParam);
[...]
> }
>
>
> int main(int argc, char **argv)
> {
> pthread_create(&t1, 0, func,(void*)1);

I could imagine that the created thread has finished before this call
returns and the correct value for t1 is set. Accessing t1 before it holds
anything useful might lead to such errors.

Uli