/[svn]/linuxsampler/trunk/src/common/Mutex.cpp
ViewVC logotype

Diff of /linuxsampler/trunk/src/common/Mutex.cpp

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 290 by senkov, Wed Oct 20 03:02:35 2004 UTC revision 819 by wylder, Thu Dec 22 19:37:19 2005 UTC
# Line 24  Line 24 
24  # define _GNU_SOURCE 1 /* so _XOPEN_SOURCE will be defined by features.h */  # define _GNU_SOURCE 1 /* so _XOPEN_SOURCE will be defined by features.h */
25  #endif  #endif
26    
27  #include <features.h>  #if defined(HAVE_FEATURES_H) && (HAVE_FEATURE  != 0)
28    # include <features.h>
29    #endif
30    
31  #if !defined(_XOPEN_SOURCE) || _XOPEN_SOURCE < 500  #if !defined(_XOPEN_SOURCE) || _XOPEN_SOURCE < 500
32  # undef _XOPEN_SOURCE  # undef _XOPEN_SOURCE
# Line 42  Line 44 
44    
45  Mutex::Mutex() {  Mutex::Mutex() {
46      // the following function call only works on UNIX98 compatible systems      // the following function call only works on UNIX98 compatible systems
47        #if (_XOPEN_SOURCE > 500)
48      if (pthread_mutexattr_settype(&__posix_mutexattr, PTHREAD_MUTEX_ERRORCHECK)) {      if (pthread_mutexattr_settype(&__posix_mutexattr, PTHREAD_MUTEX_ERRORCHECK)) {
49          std::cout << "Mutex Constructor: Fatal error - unable to pthread_mutexattr_settype(PTHREAD_MUTEX_ERRORCHECK)\n" << std::flush;          std::cout << "Mutex Constructor: Fatal error - unable to pthread_mutexattr_settype(PTHREAD_MUTEX_ERRORCHECK)\n" << std::flush;
50          exit(-1);          exit(-1);
51      }      }
52        #endif
53      pthread_mutex_init(&__posix_mutex, &__posix_mutexattr);      pthread_mutex_init(&__posix_mutex, &__posix_mutexattr);
54  }  }
55    

Legend:
Removed from v.290  
changed lines
  Added in v.819

  ViewVC Help
Powered by ViewVC