On 28 May 2011 01:43, Jonathan Wakely wrote: > This patch uses glibc's get_nprocs() or the non-standard but widely > available _SC_NPROCESSORS_ONLN sysconf variable to determine the > number of processors. > > 2011-05-28 Jonathan Wakely <jwakely....@gmail.com> > > * acinclude.m4: Define GLIBCXX_CHECK_GET_NPROCS and > GLIBCXX_CHECK_SC_NPROCESSORS_ONLN. > * configure.ac: Use them. Increase minor version. > * configure: Regenerate. > * config.h.in: Regenerate. > * include/std/thread (thread::hardware_concurrency): Remove inline > definition. > * src/thread.cc (thread::hardware_concurrency): Define. > * config/abi/pre/gnu.ver: Export new symbol @3.4.17 > * testsuite/util/testsuite_abi.cc: Add new version. > * testsuite/lib/libstdc++.exp (check_v3_target_nprocs): Add. > * testsuite/lib/dg-options.exp (dg-require-nprocs): Add. > * testsuite/30_threads/thread/members/hardware_concurrency.cc: Use > dg-require-nprocs and verify hardware_concurrency returns non-zero. > > > Tested x86_64-linux, I intend to commit to trunk tomorrow.
I've checked that patch in, so the library version on mainline is libstdc++.so.6.0.17 now. If my configury changes or using sysconf breaks anything I'll try to fix it asap.