{"thread":{"id":"42871","subject":"[PATCH] configure.ac: stronger test for pthread linkage","startedAt":"2016-07-18T10:22:14Z","lastAt":"2016-07-18T10:22:14Z","messageCount":1,"participants":["Eric Wong"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"291648","messageId":"20160718102208.GA23220@starla","threadId":"42871","inReplyTo":null,"subject":"[PATCH] configure.ac: stronger test for pthread linkage","fromName":"Eric Wong","fromEmail":"e@80x24.org","sentAt":"2016-07-18T10:22:08Z","receivedAt":"2016-07-18T10:22:14Z","isPatch":true,"sender":{"key":"e@80x24.org","avatar":null},"body":"We need to test linkage of pthread_create and pthread_join,\nas pthread_mutex_* and pthread_key_* functions do not need\nextra linkage under FreeBSD 10.3, leading to a false-positive\nof the empty case.\n\nSigned-off-by: Eric Wong <e@80x24.org>\n---\n configure.ac | 5 +++++\n 1 file changed, 5 insertions(+)\n\ndiff --git a/configure.ac b/configure.ac\nindex c279025..aa9c91d 100644\n--- a/configure.ac\n+++ b/configure.ac\n@@ -1108,14 +1108,19 @@ GIT_CONF_SUBST([HAVE_BSD_SYSCTL])\n AC_DEFUN([PTHREADTEST_SRC], [\n AC_LANG_PROGRAM([[\n #include <pthread.h>\n+static void *noop(void *ignore) { return ignore; }\n ]], [[\n \tpthread_mutex_t test_mutex;\n \tpthread_key_t test_key;\n+\tpthread_t th;\n \tint retcode = 0;\n+\tvoid *ret = (void *)0;\n \tretcode |= pthread_key_create(&test_key, (void *)0);\n \tretcode |= pthread_mutex_init(&test_mutex,(void *)0);\n \tretcode |= pthread_mutex_lock(&test_mutex);\n \tretcode |= pthread_mutex_unlock(&test_mutex);\n+\tretcode |= pthread_create(&th, ret, noop, ret);\n+\tretcode |= pthread_join(th, &ret);\n \treturn retcode;\n ]])])\n \n-- \nEW\n"}]}