Changeset 139 for trunk


Ignore:
Timestamp:
Oct 28, 2007, 4:59:22 PM (17 years ago)
Author:
rainer
Message:

Detect availability of recursive mutexes on Linux.

Location:
trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/aclocal.m4

    r138 r139  
    17941794        fi
    17951795
     1796        # Detect PTHREAD_MUTEX_RECURSIVE
     1797        AC_MSG_CHECKING([for recursive mutexes])
     1798        mutex_recursive=no
     1799        AC_TRY_LINK([
     1800#define _XOPEN_SOURCE 500
     1801#include <pthread.h>], [
     1802pthread_mutexattr_t   mta;
     1803pthread_mutexattr_settype(&mta, PTHREAD_MUTEX_RECURSIVE);
     1804return 0;],[mutex_recursive=yes])
     1805        if test "x$mutex_recursive" = "xyes"
     1806        then
     1807          AC_DEFINE(HAVE_PTHREAD_MUTEX_RECURSIVE,1,[Define if you have recursive mutexes.])
     1808        fi
     1809        AC_MSG_RESULT($mutex_recursive)
     1810
    17961811        LIBS="$save_LIBS"
    17971812        CFLAGS="$save_CFLAGS"
  • trunk/include/sh_pthread.h

    r138 r139  
    3636 * ----   Recursive mutex  ----
    3737 */
    38 #if defined(PTHREAD_MUTEX_RECURSIVE)
     38#if defined(HAVE_PTHREAD_MUTEX_RECURSIVE)
    3939
    4040/* On GNU C, it's an enum, thus the alternative implementation
  • trunk/src/sh_mem.c

    r138 r139  
    1919
    2020#include "config_xor.h"
     21
     22#if defined(HAVE_PTHREAD_MUTEX_RECURSIVE)
     23#define _XOPEN_SOURCE 500
     24#endif
    2125
    2226#include <stdio.h>
  • trunk/src/sh_pthread.c

    r138 r139  
    1515}
    1616
    17 
     17#if !defined(HAVE_PTHREAD_MUTEX_RECURSIVE)
    1818/**
    1919 * libxml2 threads.c: set of generic threading related routines
     
    7373}
    7474#endif
     75
     76
     77#endif
Note: See TracChangeset for help on using the changeset viewer.