Mail Archives: cygwin/2004/10/10/13:46:10
gmiller AT cfl DOT rr DOT com wrote:
>
> I have a sample thread application that runs under Ferdora Core 2 latest but exits on an error condition under cygwin.
"lab4_1.c" Oh boy, there's nothing I like better than fixing someone's
homework assignment.
That aside, what you included doesn't compile:
lab4_1.c:13:32: ../inc/local_mutex.h: No such file or directory
lab4_1.c:49: error: `PTHREAD_COND_INITIALIZER' undeclared here (not in a
function)
lab4_1.c:50: error: `PTHREAD_MUTEX_INITIALIZER' undeclared here (not in
a function)
lab4_1.c:52: error: `PTHREAD_COND_INITIALIZER' undeclared here (not in a
function)
lab4_1.c:53: error: `PTHREAD_MUTEX_INITIALIZER' undeclared here (not in
a function)
lab4_1.c:55: error: `PTHREAD_MUTEX_INITIALIZER' undeclared here (not in
a function)
If you remove the "../inc/local_mutex.h" thing, whatever that is, and
include pthread.h as you should, it compiles and runs fine:
$ ./lab4_1
waiting do_one_thing
waiting do_another_thing
Ready to start threads .....
&Starting ... do_one_thing
+++++Starting ... do_another_thing
---------+++++-----------+++++++++++---------+++++++++++-----------++++++++-----------+++++++++++--------+++++++++++-----------+++++++++++--------+++++++++++-----------++++++++------++++++++@(!(-----@)#^
All threads complete
!)
wrap up: doing another 100, another 100, total 200
Brian
--
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Problem reports: http://cygwin.com/problems.html
Documentation: http://cygwin.com/docs.html
FAQ: http://cygwin.com/faq/
- Raw text -