diff options
Diffstat (limited to 'ace')
-rw-r--r-- | ace/OS.h | 2 | ||||
-rw-r--r-- | ace/OS.i | 15 | ||||
-rw-r--r-- | ace/README | 2 | ||||
-rw-r--r-- | ace/Reactor.cpp | 7 | ||||
-rw-r--r-- | ace/Service_Config.cpp | 8 | ||||
-rw-r--r-- | ace/config-chorus.h | 5 | ||||
-rw-r--r-- | ace/config-win32-common.h | 2 |
7 files changed, 29 insertions, 12 deletions
@@ -2506,7 +2506,7 @@ struct sigaction // Why is this defined? It must be a std C library symbol. #if !defined (NSIG) -#define NSIG 1 +#define NSIG 0 #endif /* NSIG */ #if !defined (R_OK) @@ -456,8 +456,13 @@ extern "C" char *mktemp (char *); // This is necessary to work around nasty problems with MVS C++. extern "C" void ace_mutex_lock_cleanup_adapter (void *args); #define ACE_PTHREAD_CLEANUP_PUSH(A) pthread_cleanup_push (ace_mutex_lock_cleanup_adapter, (void *) A); -#else +#define ACE_PTHREAD_CLEANUP_POP(A) pthread_cleanup_pop(A) +#elif !defined (ACE_LACKS_PTHREAD_CLEANUP) #define ACE_PTHREAD_CLEANUP_PUSH(A) pthread_cleanup_push (ACE_OS::mutex_lock_cleanup, (void *) A); +#define ACE_PTHREAD_CLEANUP_POP(A) pthread_cleanup_pop(A) +#else +#define ACE_PTHREAD_CLEANUP_PUSH(A) +#define ACE_PTHREAD_CLEANUP_POP(A) #endif /* ACE_HAS_THR_C_FUNC */ #if defined (ACE_HAS_REGEX) @@ -1736,6 +1741,7 @@ ACE_OS::sema_destroy (ACE_sema_t *s) // ACE_TRACE ("ACE_OS::sema_destroy"); #if defined (ACE_HAS_POSIX_SEM) int result; +#if !defined (ACE_LACKS_NAMED_POSIX_SEM) if (s->name_) { ACE_OS::free ((void *) s->name_); @@ -1743,6 +1749,7 @@ ACE_OS::sema_destroy (ACE_sema_t *s) ACE_OSCALL_RETURN (ACE_ADAPT_RETVAL (::sem_close (s->sema_), ace_result_), int, -1); } else +#endif /* ACE_LACKS_NAMED_POSIX_SEM */ { ACE_OSCALL (ACE_ADAPT_RETVAL (::sem_destroy (s->sema_), result), int, -1, result); delete s->sema_; @@ -1976,7 +1983,7 @@ ACE_OS::sema_wait (ACE_sema_t *s) if (result != -1) ACE_OS::mutex_unlock (&s->lock_); - pthread_cleanup_pop (1); + ACE_PTHREAD_CLEANUP_POP (1); return result; #elif defined (ACE_HAS_WTHREADS) @@ -2515,7 +2522,7 @@ ACE_OS::rw_rdlock (ACE_rwlock_t *rw) if (result != -1) ACE_OS::mutex_unlock (&rw->lock_); #if defined (ACE_HAS_DCETHREADS) || defined (ACE_HAS_PTHREADS) - pthread_cleanup_pop (0); + ACE_PTHREAD_CLEANUP_POP (0); #endif return 0; #endif /* ACE_HAS_STHREADS */ @@ -2676,7 +2683,7 @@ ACE_OS::rw_wrlock (ACE_rwlock_t *rw) if (result != -1) ACE_OS::mutex_unlock (&rw->lock_); #if defined (ACE_HAS_DCETHREADS) || defined (ACE_HAS_PTHREADS) - pthread_cleanup_pop (0); + ACE_PTHREAD_CLEANUP_POP (0); #endif /* defined (ACE_HAS_DCETHREADS) || defined (ACE_HAS_PTHREADS) */ return 0; #endif /* ACE_HAS_STHREADS */ diff --git a/ace/README b/ace/README index 19c782596c4..fd8cb90eda4 100644 --- a/ace/README +++ b/ace/README @@ -190,6 +190,7 @@ ACE_LACKS_NETDB_REENTRANT_FUNCTIONS Platform does not support reentrant netdb fu gethostbyname_r, getservbyname_r). ACE_LACKS_RPC_H Platform lacks the ONC RPC header files. ACE_LACKS_PARAM_H Platform lacks <sys/param.h> (e.g., MVS) +ACE_LACKS_NAMED_POSIX_SEM Platform lacks named POSIX semaphores (e.g., Chorus) ACE_LACKS_RLIMIT_PROTO Platform/compiler lacks {get,set}rlimit() prototypes (e.g., Tandem) ACE_LACKS_POSIX_PROTO Platform lacks POSIX prototypes for certain System V functions like shared memory and message queues. ACE_LACKS_PRI_T Platform lacks pri_t (e.g., Tandem NonStop UNIX). @@ -225,6 +226,7 @@ ACE_LACKS_TCP_H Platform doesn't have netinet/tcp.h ACE_LACKS_THREAD_STACK_SIZE Platform lacks pthread_attr_setstacksize() (e.g., Linux pthreads) ACE_LACKS_UCONTEXT_H Platform lacks the ucontext.h file ACE_LACKS_UNIX_DOMAIN_SOCKETS ACE platform has no UNIX domain sockets +ACE_LACKS_UNIX_SIGNALS Platform lacks full signal support (e.g., Win32 and Chorus). ACE_LACKS_UTSNAME_T Platform lacks struct utsname (e.g., Win32 and VxWorks) ACE_MT_SAFE Compile using multi-thread libraries ACE_NDEBUG Turns off debugging features diff --git a/ace/Reactor.cpp b/ace/Reactor.cpp index 420c3be9399..89e8321cc06 100644 --- a/ace/Reactor.cpp +++ b/ace/Reactor.cpp @@ -1062,14 +1062,17 @@ ACE_Reactor::register_handler (const ACE_Sig_Set &sigset, ACE_Sig_Action *new_disp) { ACE_TRACE ("ACE_Reactor::register_handler"); + int result = 0; +#if (NSIG > 0) + for (int s = 1; s < NSIG; s++) if (sigset.is_member (s) && this->signal_handler_->register_handler (s, new_sh, new_disp) == -1) result = -1; - +#endif /* NSIG */ return result; } @@ -1079,10 +1082,12 @@ ACE_Reactor::remove_handler (const ACE_Sig_Set &sigset) ACE_TRACE ("ACE_Reactor::remove_handler"); int result = 0; +#if (NSIG == 0) for (int s = 1; s < NSIG; s++) if (sigset.is_member (s) && this->signal_handler_->remove_handler (s) == -1) result = -1; +#endif /* NSIG */ return result; } diff --git a/ace/Service_Config.cpp b/ace/Service_Config.cpp index 460f0c4bf9f..c7e58775ccc 100644 --- a/ace/Service_Config.cpp +++ b/ace/Service_Config.cpp @@ -402,14 +402,14 @@ ACE_Service_Config::ACE_Service_Config (int ignore_static_svcs, // There's no point in dealing with this on NT since it doesn't really // support signals very well... -#if !defined (ACE_WIN32) +#if defined (ACE_LACKS_UNIX_SIGNALS) // This really ought to be a Singleton I suspect... if (ACE_Service_Config::reactor_->register_handler (ACE_Service_Config::signum_, &ACE_Service_Config::signal_handler_) == -1) ACE_ERROR ((LM_ERROR, "can't register signal handler\n")); -#endif /* !ACE_WIN32 */ +#endif /* ACE_LACKS_UNIX_SIGNALS */ } // Handle the command-line options intended for the @@ -440,14 +440,14 @@ ACE_Service_Config::parse_args (int argc, char *argv[]) { // There's no point in dealing with this on NT since it doesn't really // support signals very well... -#if !defined (ACE_WIN32) +#if defined (ACE_LACKS_UNIX_SIGNALS) ACE_Service_Config::signum_ = ACE_OS::atoi (getopt.optarg); if (ACE_Service_Config::reactor ()->register_handler (ACE_Service_Config::signum_, &ACE_Service_Config::signal_handler_) == -1) ACE_ERROR ((LM_ERROR, "cannot obtain signal handler\n")); -#endif /* !ACE_WIN32 */ +#endif /* ACE_LACKS_UNIX_SIGNALS */ break; } default: diff --git a/ace/config-chorus.h b/ace/config-chorus.h index ea98287a098..cbaf8537e4a 100644 --- a/ace/config-chorus.h +++ b/ace/config-chorus.h @@ -16,6 +16,7 @@ #undef linux #endif +#define ACE_LACKS_UNIX_SIGNALS #define ACE_HAS_IP_MULTICAST #define ACE_LACKS_MPROTECT #define ACE_LACKS_SOCKETPAIR @@ -86,11 +87,13 @@ // Yes, we do have threads. #define ACE_HAS_THREADS -//#define ACE_HAS_POSIX_SEM +#define ACE_HAS_POSIX_SEM +#define ACE_LACKS_NAMED_POSIX_SEM #define ACE_HAS_THREAD_SPECIFIC_STORAGE #define ACE_MT_SAFE // And they're even POSIX pthreads #define ACE_HAS_PTHREADS +#define ACE_LACKS_PTHREAD_CLEANUP #define ACE_LACKS_RWLOCK_T #define ACE_HAS_SIGWAIT #define ACE_LACKS_CONDATTR_PSHARED diff --git a/ace/config-win32-common.h b/ace/config-win32-common.h index 6af6ff62537..3b5b543e3fd 100644 --- a/ace/config-win32-common.h +++ b/ace/config-win32-common.h @@ -17,7 +17,7 @@ #define ACE_LACKS_SIGACTION #define ACE_LACKS_SIGSET #define ACE_LACKS_EXEC - +#define ACE_LACKS_UNIX_SIGNALS #define ACE_LACKS_SBRK #define ACE_LACKS_UTSNAME_T #define ACE_LACKS_SEMBUF_T |