Skip to content

Commit a9b02de

Browse files
Eric Wonggitster
authored andcommitted
configure.ac: stronger test for pthread linkage
We need to test linkage of pthread_create and pthread_join, as pthread_mutex_* and pthread_key_* functions do not need extra linkage under FreeBSD 10.3, leading to a false-positive of the empty case. Signed-off-by: Eric Wong <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 7654286 commit a9b02de

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

configure.ac

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1083,14 +1083,19 @@ GIT_CONF_SUBST([HAVE_BSD_SYSCTL])
10831083
AC_DEFUN([PTHREADTEST_SRC], [
10841084
AC_LANG_PROGRAM([[
10851085
#include <pthread.h>
1086+
static void *noop(void *ignore) { return ignore; }
10861087
]], [[
10871088
pthread_mutex_t test_mutex;
10881089
pthread_key_t test_key;
1090+
pthread_t th;
10891091
int retcode = 0;
1092+
void *ret = (void *)0;
10901093
retcode |= pthread_key_create(&test_key, (void *)0);
10911094
retcode |= pthread_mutex_init(&test_mutex,(void *)0);
10921095
retcode |= pthread_mutex_lock(&test_mutex);
10931096
retcode |= pthread_mutex_unlock(&test_mutex);
1097+
retcode |= pthread_create(&th, ret, noop, ret);
1098+
retcode |= pthread_join(th, &ret);
10941099
return retcode;
10951100
]])])
10961101

0 commit comments

Comments
 (0)