Merge branch 'ew/autoconf-pthread' into maint

Existing autoconf generated test for the need to link with pthread
library did not check all the functions from pthread libraries;
recent FreeBSD has some functions in libc but not others, and we
mistakenly thought linking with libc is enough when it is not.

* ew/autoconf-pthread:
  configure.ac: stronger test for pthread linkage
This commit is contained in:
Junio C Hamano 2016-08-10 11:55:20 -07:00
Родитель e223c2c77f a9b02de8b7
Коммит f98a20c50a
1 изменённых файлов: 5 добавлений и 0 удалений

Просмотреть файл

@ -1108,14 +1108,19 @@ GIT_CONF_SUBST([HAVE_BSD_SYSCTL])
AC_DEFUN([PTHREADTEST_SRC], [
AC_LANG_PROGRAM([[
#include <pthread.h>
static void *noop(void *ignore) { return ignore; }
]], [[
pthread_mutex_t test_mutex;
pthread_key_t test_key;
pthread_t th;
int retcode = 0;
void *ret = (void *)0;
retcode |= pthread_key_create(&test_key, (void *)0);
retcode |= pthread_mutex_init(&test_mutex,(void *)0);
retcode |= pthread_mutex_lock(&test_mutex);
retcode |= pthread_mutex_unlock(&test_mutex);
retcode |= pthread_create(&th, ret, noop, ret);
retcode |= pthread_join(th, &ret);
return retcode;
]])])