
Peter Dimov wrote:
I'm looking at the results of some new tests I added to smart_ptr: spinlock_try_test, yield_k_test, and I'm seeing failures on platforms that (in single threaded mode, i.e. without <threading>multi) advertise BOOST_HAS_PTHREADS (and BOOST_HAS_SCHED_YIELD) but in reality do one of:
1. provide stub implementations of pthread_mutex_*, failing a pthread_mutex_trylock test;
2. provide stubs and segfault on pthread_mutex_trylock;
3. fail to link because of missing pthread_mutex_trylock;
4. fail to link because of missing sched_yield.
This isn't particularly odd or surprising. But I think that config_test ought to fail on these platforms, for the same reason my tests fail. The reason the test passes is because boost_has_pthreads.ipp and boost_has_sched_yield.ipp are too permissive; the first one only tests pthread_mutex_* functions that are stubbed and appear to work, the second doesn't attempt to actually call sched_yield and - presumably - the linker discards the reference.
Does this make any sense? :-)
Yes, but the intention was that you check for BOOST_HAS_THREADS before the other macros. John.