|
Boost : |
From: John Maddock (John_Maddock_at_[hidden])
Date: 2001-10-30 07:34:56
>Sorry, I must be dense. Both issues? I see two issues below:
>pthread_cond_wait() returning 0 instead of an error for timeout and
>pthread_equal() not working. If -mt fixes both of these then what
>exactly is asserting?
OK, with sunpro, you see the failed assertion (and you have to use -mt
otherwise the thread lib doesn't compile).
With gcc there is a -pthreads option, but I see std lib related linker
errors if I use this (there appear to be no std exception classes???).
If I use:
g++ -I../../ sources -lrt
Then I see the errors I reported, but with:
g++ -I../../ src/*.cpp test/*.cpp -lrt -lpthread
Then I see the same behaviour as with sunpro. Looks like the runtime has a
stub non-functioning pthreads lib in it, and you need to link to the real
-lpthread to get the correct behaviour.
The cause is the same - you are waiting on a condition variable when there
is only one thread - the thread scheduler knows that the condition can
never be signalled, and so gives up.
- John Maddock
http://ourworld.compuserve.com/homepages/john_maddock/
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk