From f6dfda501e0cb062089a8548610b55342bea7c56 Mon Sep 17 00:00:00 2001 From: Steve Huston Date: Fri, 6 Jul 2007 15:14:47 +0000 Subject: ChangeLogTag:Fri Jul 6 14:52:00 UTC 2007 Steve Huston --- ACE/ace/OS_NS_Thread.inl | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) (limited to 'ACE/ace/OS_NS_Thread.inl') diff --git a/ACE/ace/OS_NS_Thread.inl b/ACE/ace/OS_NS_Thread.inl index f2c462fc316..61f9d34b221 100644 --- a/ACE/ace/OS_NS_Thread.inl +++ b/ACE/ace/OS_NS_Thread.inl @@ -1361,10 +1361,10 @@ ACE_OS::sema_destroy (ACE_sema_t *s) ACE_OS_TRACE ("ACE_OS::sema_destroy"); # if defined (ACE_HAS_POSIX_SEM) int result; -# if !defined (ACE_HAS_POSIX_SEM_TIMEOUT) && defined (ACE_HAS_POSIX_SEM_TIMEOUT_EMULATION) +# if !defined (ACE_HAS_POSIX_SEM_TIMEOUT) && !defined (ACE_DISABLE_POSIX_SEM_TIMEOUT_EMULATION) ACE_OS::mutex_destroy (&s->lock_); ACE_OS::cond_destroy (&s->count_nonzero_); -# endif /* !ACE_HAS_POSIX_SEM_TIMEOUT && ACE_HAS_POSIX_SEM_TIMEOUT_EMULATION */ +# endif /* !ACE_HAS_POSIX_SEM_TIMEOUT && !ACE_DISABLE_POSIX_SEM_TIMEOUT_EMULATION */ # if defined (ACE_LACKS_NAMED_POSIX_SEM) if (s->name_) { @@ -1451,7 +1451,7 @@ ACE_OS::sema_init (ACE_sema_t *s, ACE_UNUSED_ARG (sa); s->name_ = 0; -# if defined (ACE_HAS_POSIX_SEM_TIMEOUT) || !defined (ACE_HAS_POSIX_SEM_TIMEOUT_EMULATION) +# if defined (ACE_HAS_POSIX_SEM_TIMEOUT) || defined (ACE_DISABLE_POSIX_SEM_TIMEOUT_EMULATION) ACE_UNUSED_ARG (arg); # else int result = -1; @@ -1471,7 +1471,7 @@ ACE_OS::sema_init (ACE_sema_t *s, ACE_OS::cond_destroy (&s->count_nonzero_); return result; } -# endif /* ACE_HAS_POSIX_SEM_TIMEOUT || !ACE_HAS_POSIX_SEM_TIMEOUT_EMULATION */ +# endif /* ACE_HAS_POSIX_SEM_TIMEOUT || ACE_DISABLE_POSIX_SEM_TIMEOUT_EMULATION */ # if defined (ACE_LACKS_NAMED_POSIX_SEM) s->new_sema_ = 0; @@ -1837,7 +1837,7 @@ ACE_OS::sema_post (ACE_sema_t *s) { ACE_OS_TRACE ("ACE_OS::sema_post"); # if defined (ACE_HAS_POSIX_SEM) -# if defined (ACE_HAS_POSIX_SEM_TIMEOUT) || !defined (ACE_HAS_POSIX_SEM_TIMEOUT_EMULATION) +# if defined (ACE_HAS_POSIX_SEM_TIMEOUT) || defined (ACE_DISABLE_POSIX_SEM_TIMEOUT_EMULATION) ACE_OSCALL_RETURN (::sem_post (s->sema_), int, -1); # else int result = -1; @@ -1850,7 +1850,7 @@ ACE_OS::sema_post (ACE_sema_t *s) ACE_OS::mutex_unlock (&s->lock_); } return result; -# endif /* ACE_HAS_POSIX_SEM_TIMEOUT || !ACE_HAS_POSIX_SEM_TIMEOUT_EMULATION */ +# endif /* ACE_HAS_POSIX_SEM_TIMEOUT || ACE_DISABLE_POSIX_SEM_TIMEOUT_EMULATION */ # elif defined (ACE_USES_FIFO_SEM) char c = 1; if (ACE_OS::write (s->fd_[1], &c, sizeof (char)) == sizeof (char)) @@ -2177,8 +2177,7 @@ ACE_OS::sema_wait (ACE_sema_t *s, ACE_Time_Value &tv) if (rc == -1 && errno == ETIMEDOUT) errno = ETIME; /* POSIX returns ETIMEDOUT but we need ETIME */ return rc; -# else -# if defined (ACE_HAS_POSIX_SEM_TIMEOUT_EMULATION) +# elif !defined (ACE_DISABLE_POSIX_SEM_TIMEOUT_EMULATION) int result = 0; bool expired = false; ACE_Errno_Guard error (errno); @@ -2225,12 +2224,11 @@ ACE_OS::sema_wait (ACE_sema_t *s, ACE_Time_Value &tv) ACE_OS::mutex_unlock (&s->lock_); ACE_PTHREAD_CLEANUP_POP (0); return result < 0 ? -1 : result; -# else +# else /* No native sem_timedwait(), and emulation disabled */ ACE_UNUSED_ARG (s); ACE_UNUSED_ARG (tv); ACE_NOTSUP_RETURN (-1); -# endif /* ACE_HAS_POSIX_SEM_TIMEOUT_EMULATION */ -# endif /* !ACE_HAS_POSIX_SEM_TIMEOUT */ +# endif /* ACE_HAS_POSIX_SEM_TIMEOUT */ # elif defined (ACE_USES_FIFO_SEM) int rc; ACE_Time_Value now = ACE_OS::gettimeofday (); -- cgit v1.2.1