File: lam_mutex_pshared.m4

package info (click to toggle)
lam 7.1.1-3
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 53,848 kB
  • ctags: 17,183
  • sloc: ansic: 155,642; sh: 9,196; cpp: 7,694; makefile: 5,560; perl: 476; fortran: 260
file content (28 lines) | stat: -rw-r--r-- 1,116 bytes parent folder | download | duplicates (10)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
dnl -*- shell-script -*-
dnl
dnl Copyright (c) 2001-2002 The Trustees of Indiana University.  
dnl                         All rights reserved.
dnl Copyright (c) 1998-2001 University of Notre Dame. 
dnl                         All rights reserved.
dnl Copyright (c) 1994-1998 The Ohio State University.  
dnl                         All rights reserved.
dnl 
dnl This file is part of the LAM/MPI software package.  For license
dnl information, see the LICENSE file in the top level directory of the
dnl LAM/MPI source distribution.
dnl
dnl $Id: lam_mutex_pshared.m4,v 1.3 2002/10/09 20:55:12 brbarret Exp $
dnl

define(LAM_MUTEX_PSHARED,[
AC_MSG_CHECKING(for process shared pthread mutex)
AC_TRY_RUN([#include <pthread.h>
int main(int argc, char* argv[]) {
  pthread_mutex_t m; pthread_mutexattr_t mattr;
  if (pthread_mutexattr_init(&mattr)) return(1);
  if (pthread_mutexattr_setpshared(&mattr, PTHREAD_PROCESS_SHARED)) return(1);
  if (pthread_mutex_init(&m, &mattr)) return(-1);
  return(0);
}], lam_ac_mutex_pshared=yes, lam_ac_mutex_pshared=no, lam_ac_mutex_pshared=no)
AC_MSG_RESULT($lam_ac_mutex_pshared)
])