VirtualBox

source: kBuild/trunk/src/grep/m4/lock.m4

Last change on this file was 3529, checked in by bird, 3 years ago

Imported grep 3.7 from grep-3.7.tar.gz (sha256: c22b0cf2d4f6bbe599c902387e8058990e1eee99aef333a203829e5fd3dbb342), applying minimal auto-props.

  • Property svn:eol-style set to LF
File size: 1.5 KB
Line 
1# lock.m4 serial 14
2dnl Copyright (C) 2005-2021 Free Software Foundation, Inc.
3dnl This file is free software; the Free Software Foundation
4dnl gives unlimited permission to copy and/or distribute it,
5dnl with or without modifications, as long as this notice is preserved.
6
7dnl From Bruno Haible.
8
9AC_DEFUN([gl_LOCK],
10[
11 AC_REQUIRE([gl_THREADLIB])
12 if test "$gl_threads_api" = posix; then
13 # OSF/1 4.0 and Mac OS X 10.1 lack the pthread_rwlock_t type and the
14 # pthread_rwlock_* functions.
15 has_rwlock=false
16 AC_CHECK_TYPE([pthread_rwlock_t],
17 [has_rwlock=true
18 AC_DEFINE([HAVE_PTHREAD_RWLOCK], [1],
19 [Define if the POSIX multithreading library has read/write locks.])],
20 [],
21 [#include <pthread.h>])
22 if $has_rwlock; then
23 gl_PTHREAD_RWLOCK_RDLOCK_PREFER_WRITER
24 fi
25 # glibc defines PTHREAD_MUTEX_RECURSIVE as enum, not as a macro.
26 AC_COMPILE_IFELSE([
27 AC_LANG_PROGRAM(
28 [[#include <pthread.h>]],
29 [[
30#if __FreeBSD__ == 4
31error "No, in FreeBSD 4.0 recursive mutexes actually don't work."
32#elif (defined __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ \
33 && __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ < 1070)
34error "No, in Mac OS X < 10.7 recursive mutexes actually don't work."
35#else
36int x = (int)PTHREAD_MUTEX_RECURSIVE;
37return !x;
38#endif
39 ]])],
40 [AC_DEFINE([HAVE_PTHREAD_MUTEX_RECURSIVE], [1],
41 [Define if the <pthread.h> defines PTHREAD_MUTEX_RECURSIVE.])])
42 fi
43 gl_PREREQ_LOCK
44])
45
46# Prerequisites of lib/glthread/lock.c.
47AC_DEFUN([gl_PREREQ_LOCK], [:])
Note: See TracBrowser for help on using the repository browser.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette