Example Posix, wath's wrong ?
joel.sherrill at oarcorp.com
Thu Feb 16 14:21:06 UTC 2006
>What's wrong in so this simple example of posix threads ? I have error when I
>launch it on the pthread_create and pthread_join .
>I compile it correctly using the makefile of hello world.
OK. It was VERY close. :)
You forgot to have a CONFIGURE_INIT at the bottom before including
so you did not actually instantiate the configuration you specified.
I also tinkered with the example to use distinct variables for child1
and child2 IDs,
to capture the status variable so you can look at it in the debugger, to
use a POSIX
thread as the init task as you specified in the configuration, and to
exit at the bottom
of your main thread. As it was, the main thread returned and the system
Runs now. It isn't as different as it sounds, just cleaned up a bit.
Really only two
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 1067 bytes
Desc: not available
More information about the users