[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Example Posix, wath's wrong ?
- Date: Thu, 16 Feb 2006 08:21:06 -0600
- From: joel.sherrill at oarcorp.com (Joel Sherrill)
- Subject: Example Posix, wath's wrong ?
Matteo wrote:
>Hi
>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
confdefs.h
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
did not
exit.
Runs now. It isn't as different as it sounds, just cleaned up a bit.
Really only two
functional changes.
--joel
-------------- next part --------------
A non-text attachment was scrubbed...
Name: test.c
Type: text/x-csrc
Size: 1067 bytes
Desc: not available
Url : http://rtems.rtems.org/pipermail/rtems-users/attachments/20060216/8d101128/attachment.bin