473870 FreeBSD 14 applications fail early at startup
473944 Handle mold linker split RW PT_LOAD segments correctly
474332 aligned_alloc under Valgrind returns nullptr when alignment is not a multiple of sizeof(void *)
+475650 DRD does not work with C11 threads
n-i-bz Allow arguments with spaces in .valgrindrc files
n-i-bz FreeBSD fixed reading of Valgrind tools own debuginfo
AM_CONDITIONAL(CXX_CAN_INCLUDE_THREAD_HEADER, test x$ac_cxx_can_include_thread_header = xyes)
+AC_MSG_CHECKING([that the C++ compiler supports thrd_create()])
+AC_LANG(C++)
+safe_CXXFLAGS=$CXXFLAGS
+CXXFLAGS=-std=c++11
+
+AC_COMPILE_IFELSE([AC_LANG_PROGRAM([
+#include <threads.h>
+], [[thrd_t thr; return thrd_create(&thr, [](void *arg){return 0;}, NULL);]])],
+[
+ac_cxx_have_thrd_create=yes
+AC_MSG_RESULT([yes])
+], [
+ac_cxx_have_thrd_create=no
+AC_MSG_RESULT([no])
+])
+CXXFLAGS=$safe_CXXFLAGS
+AC_LANG(C)
+
+AM_CONDITIONAL(CXX_HAVE_THRD_CREATE, test x$ac_cxx_have_thrd_create = xyes)
+
# Check whether compiler can process #include <condition_variable> without errors
AC_MSG_CHECKING([that C++ compiler can include <condition_variable> header file])
* this means that the new thread will be started as a joinable thread.
*/
thread_args.detachstate = PTHREAD_CREATE_JOINABLE;
- if (attr)
+ /* The C11 thrd_create() implementation passes -1 as 'attr' argument. */
+ if (attr && (uintptr_t)attr + 1 != 0)
{
if (pthread_attr_getdetachstate(attr, &thread_args.detachstate) != 0)
assert(0);
tc23_bogus_condwait.vgtest \
tc24_nonzero_sem.stderr.exp \
tc24_nonzero_sem.vgtest \
+ thrd_create.stderr.exp \
+ thrd_create.vgtest \
thread_name.stderr.exp \
thread_name.vgtest \
thread_name_xml.stderr.exp \
check_PROGRAMS += swapcontext
endif
+if CXX_HAVE_THRD_CREATE
+check_PROGRAMS += thrd_create
+endif
+
if !VGCONF_OS_IS_DARWIN
check_PROGRAMS += sem_wait
endif
timed_mutex_SOURCES = timed_mutex.cpp
timed_mutex_CXXFLAGS = $(AM_CXXFLAGS) -std=c++0x
+
+thrd_create_SOURCES = thrd_create.cpp
--- /dev/null
+#include <threads.h>
+#include <iostream>
+
+int main()
+{
+ thrd_t thr;
+ thrd_create(&thr, [](void *arg){std::cerr << "Hello, world!\n"; return 0;},
+ NULL);
+ thrd_join(thr, NULL);
+ return 0;
+}
--- /dev/null
+
+Hello, world!
+
+ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)
--- /dev/null
+prereq: test -e thrd_create && ./supported_libpthread
+prog: thrd_create