Changeset 21049
- Timestamp:
- 02/23/08 12:45:32 (6 months ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
juggler/trunk/modules/vapor/configure.ac
r21038 r21049 341 341 AC_MSG_WARN(*** POSIX threads will not be used (no library found) ***) 342 342 fi 343 344 DPP_LANG_SAVE 345 DPP_LANG_C 346 347 vprsave_CFLAGS="$CFLAGS" 348 vprsave_LIBS="$LIBS" 349 350 CFLAGS="$CFLAGS $PTHREAD_ARG" 351 LIBS="$LIBS $PTHREAD_LIB" 352 353 # If the code below compiles, links, and returns 0, then we can use 354 # unnamed POSIX semaphores. 355 AC_CACHE_CHECK([for unnamed POSIX semaphore support], 356 [ac_cv_has_unnamed_posix_semaphores], 357 [AC_RUN_IFELSE([ 358 #include <semaphore.h> 359 360 int main() 361 { 362 sem_t sema; 363 return sem_init(&sema, 0, 1); 364 }], 365 [ac_cv_has_unnamed_posix_semaphores='yes'], 366 [ac_cv_has_unnamed_posix_semaphores='no'])] 367 ) 368 369 if test "x$ac_cv_has_unnamed_posix_semaphores" = "xyes" ; then 370 AC_DEFINE(VPR_HAVE_UNNAMED_POSIX_SEMAPHORE, , 371 [Define if unnamed POSIX semaphores are available.]) 372 fi 373 374 CFLAGS="$vprsave_CFLAGS" 375 LIBS="$vprsave_LIBS" 376 377 DPP_LANG_RESTORE 343 378 344 379 # Do not define _POSIX_C_SOURCE here because it will cause problems when juggler/trunk/modules/vapor/vpr/md/POSIX/Sync/SemaphorePosix.cpp
r20974 r21049 46 46 #include <vpr/md/POSIX/Sync/SemaphorePosix.h> 47 47 48 #if defined(VPR_OS_Darwin) && VPR_OS_RELEASE_MAJOR <= 949 #define VPR_USE_NAMED_SEMAPHORE 150 #endif51 52 48 53 49 namespace vpr … … 56 52 SemaphorePosix::SemaphorePosix(const int initialValue) 57 53 { 58 #if def VPR_USE_NAMED_SEMAPHORE54 #if ! defined(VPR_HAVE_UNNAMED_POSIX_SEMAPHORE) 59 55 // Use strdup(3) here so that mktemp(3) can modify the memory. Trying 60 56 // to modify a constant string would be bad. … … 104 100 { 105 101 // ---- Delete the semaphore --- // 106 #if def VPR_USE_NAMED_SEMAPHORE102 #if ! defined(VPR_HAVE_UNNAMED_POSIX_SEMAPHORE) 107 103 const int result = sem_close(mSema); 108 104 vprASSERT(result == 0); … … 120 116 void SemaphorePosix::reset(const int val) 121 117 { 122 #if def VPR_USE_NAMED_SEMAPHORE118 #if ! defined(VPR_HAVE_UNNAMED_POSIX_SEMAPHORE) 123 119 // First deallocate the current semaphore. 124 120 const int result = sem_close(mSema); juggler/trunk/modules/vapor/vpr/md/POSIX/Sync/SemaphorePosix.h
r20974 r21049 57 57 #include <vpr/Sync/DeadlockException.h> 58 58 59 #if defined(VPR_OS_Darwin) && VPR_OS_RELEASE_MAJOR <= 960 #define VPR_USE_NAMED_SEMAPHORE 161 #endif62 63 59 64 60 namespace vpr … … 291 287 292 288 protected: 293 #if def VPR_USE_NAMED_SEMAPHORE289 #if ! defined(VPR_HAVE_UNNAMED_POSIX_SEMAPHORE) 294 290 char* mSemaFile; 295 291 #endif … … 299 295 } // End of vpr namespace 300 296 301 #undef VPR_USE_NAMED_SEMAPHORE302 297 303 298 #endif /* _VPR_SEMAPHORE_POSIX_H_ */
