Changeset 1783 for pjproject/trunk/pjlib/src/pj/os_core_unix.c
- Timestamp:
- Feb 7, 2008 1:11:39 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjlib/src/pj/os_core_unix.c
r1589 r1783 35 35 #include <pj/errno.h> 36 36 37 #if defined(PJ_HAS_SEMAPHORE ) && PJ_HAS_SEMAPHORE!= 037 #if defined(PJ_HAS_SEMAPHORE_H) && PJ_HAS_SEMAPHORE_H != 0 38 38 # include <semaphore.h> 39 39 #endif … … 949 949 950 950 if (type == PJ_MUTEX_SIMPLE) { 951 #if defined(PJ_LINUX) && PJ_LINUX!=0 951 #if (defined(PJ_LINUX) && PJ_LINUX!=0) || \ 952 defined(PJ_HAS_PTHREAD_MUTEXATTR_SETTYPE) 952 953 rc = pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_FAST_NP); 953 #elif defined(PJ_RTEMS) && PJ_RTEMS!=0 954 #elif (defined(PJ_RTEMS) && PJ_RTEMS!=0) || \ 955 defined(PJ_PTHREAD_MUTEXATTR_T_HAS_RECURSIVE) 954 956 /* Nothing to do, default is simple */ 955 957 #else … … 957 959 #endif 958 960 } else { 959 #if defined(PJ_LINUX) && PJ_LINUX!=0 961 #if (defined(PJ_LINUX) && PJ_LINUX!=0) || \ 962 defined(PJ_HAS_PTHREAD_MUTEXATTR_SETTYPE) 960 963 rc = pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE_NP); 961 #elif defined(PJ_RTEMS) && PJ_RTEMS!=0 964 #elif (defined(PJ_RTEMS) && PJ_RTEMS!=0) || \ 965 defined(PJ_PTHREAD_MUTEXATTR_T_HAS_RECURSIVE) 962 966 // Phil Torre <ptorre@zetron.com>: 963 967 // The RTEMS implementation of POSIX mutexes doesn't include 964 968 // pthread_mutexattr_settype(), so what follows is a hack 965 969 // until I get RTEMS patched to support the set/get functions. 970 // 971 // More info: 972 // newlib's pthread also lacks pthread_mutexattr_settype(), 973 // but it seems to have mutexattr.recursive. 966 974 PJ_TODO(FIX_RTEMS_RECURSIVE_MUTEX_TYPE) 967 975 attr.recursive = 1; … … 1240 1248 */ 1241 1249 #if defined(PJ_EMULATE_RWMUTEX) && PJ_EMULATE_RWMUTEX!=0 1242 # include "os_rwmutex.c" 1250 /* We need semaphore functionality to emulate rwmutex */ 1251 # if !defined(PJ_HAS_SEMAPHORE) || PJ_HAS_SEMAPHORE==0 1252 # error "Semaphore support needs to be enabled to emulate rwmutex" 1253 # endif 1254 # include "os_rwmutex.c" 1243 1255 #else 1244 1256 struct pj_rwmutex_t
Note: See TracChangeset
for help on using the changeset viewer.