GNOME Bugzilla – Bug 592314
core/tests/examples/streams/ does not link to pthread
Last modified: 2009-08-21 08:55:59 UTC
testrtpool.c does use pthread a lot and includes pthread.h, but there is no traces of -lpthread in Makefile.am As a result, ld complains about undefined symbols while linking rtpool-test on systems where -lpthread is not implicit (such as Windows). Fix: add -lpthread to rtpool_test_LDADD
commit b0b971ff322e22c1202ec100525e140068d0b911 Author: Sebastian Dröge <sebastian.droege@collabora.co.uk> Date: Wed Aug 19 15:25:41 2009 +0200 examples: Link rtpool-test to libpthread for using the POSIX threads Also the other streams example can run without pthreads therefore enable it even if pthreads are not available. Fixes bug #592314.
Sorry for the nitpicking, but I'm not convinced this is 100% technically correct. It would be better to check for whether GThread uses posix threads as implementation and only enable the test in that case. On windows for example we might have pthreads, but GThread might use something else as implementation. It's only a test of course, but still..
(In reply to comment #2) > Sorry for the nitpicking, but I'm not convinced this is 100% technically > correct. It would be better to check for whether GThread uses posix threads as > implementation and only enable the test in that case. On windows for example we > might have pthreads, but GThread might use something else as implementation. > It's only a test of course, but still.. Hm, no. Nothing uses GThread in rtpool-test/testrtpool. The only usage of thread related things is in testrtpool.c and there pthreads are directly used. Am I missing something?
You're right. I thought the example did something else than it actually does. Sorry for the noise.