summaryrefslogtreecommitdiff
path: root/ace
diff options
context:
space:
mode:
authorschmidt <douglascraigschmidt@users.noreply.github.com>1996-11-27 06:04:10 +0000
committerschmidt <douglascraigschmidt@users.noreply.github.com>1996-11-27 06:04:10 +0000
commit60141053a72c0f2f9db1a8075b368ae69c752ab3 (patch)
treea53c24ee44d6b4fb4c6bb2d8e3168b987eb9f08b /ace
parent72d86e3b923e67c53ecff98c29ccf65e5b134d1a (diff)
downloadATCD-60141053a72c0f2f9db1a8075b368ae69c752ab3.tar.gz
foo
Diffstat (limited to 'ace')
-rw-r--r--ace/ACE.cpp6
-rw-r--r--ace/INET_Addr.cpp1
-rw-r--r--ace/Log_Msg.cpp23
-rw-r--r--ace/Map_Manager.cpp5
-rw-r--r--ace/OS.cpp16
-rw-r--r--ace/OS.h36
-rw-r--r--ace/OS.i20
-rw-r--r--ace/Pipe.cpp7
-rw-r--r--ace/README2
-rw-r--r--ace/Reactor.cpp9
-rw-r--r--ace/Reactor.h1
-rw-r--r--ace/Service_Main.cpp30
-rw-r--r--ace/Signal.cpp28
-rw-r--r--ace/Signal.h20
-rw-r--r--ace/Thread.h2
-rw-r--r--ace/Thread.i2
-rw-r--r--ace/Thread_Manager.i2
-rw-r--r--ace/Time_Request_Reply.cpp4
-rw-r--r--ace/Time_Request_Reply.h4
-rw-r--r--ace/UPIPE_Stream.cpp2
-rw-r--r--ace/config-mvs.h6
21 files changed, 134 insertions, 92 deletions
diff --git a/ace/ACE.cpp b/ace/ACE.cpp
index 73f9ac76c8e..f3f88f79ef2 100644
--- a/ace/ACE.cpp
+++ b/ace/ACE.cpp
@@ -135,7 +135,7 @@ ACE::ldfind (const char *filename,
}
if (ACE_OS::strcmp (searchfilename
- + ACE_OS::strlen(searchfilename) - ACE_OS::strlen (ACE_DLL_SUFFIX),
+ + ACE_OS::strlen (searchfilename) - ACE_OS::strlen (ACE_DLL_SUFFIX),
ACE_DLL_SUFFIX))
ACE_ERROR ((LM_NOTICE,
"CAUTION: improper name for a shared library on this patform: %s\n",
@@ -587,7 +587,9 @@ ACE::bind_port (ACE_HANDLE handle)
{
ACE_TRACE ("ACE::bind_port");
sockaddr_in sin;
- const int MAX_SHORT = 65535;
+ // This should be a constant, so I hope they never change the number
+ // of bits in a port number!
+ const int MAX_SHORT = 65535;
static int upper_limit = MAX_SHORT;
int lower_limit = IPPORT_RESERVED;
int round_trip = upper_limit;
diff --git a/ace/INET_Addr.cpp b/ace/INET_Addr.cpp
index e73fc1d503a..5a98da7ce94 100644
--- a/ace/INET_Addr.cpp
+++ b/ace/INET_Addr.cpp
@@ -400,6 +400,7 @@ ACE_INET_Addr::get_host_name (void) const
static char buf[MAXHOSTNAMELEN + 1];
::gethostname (buf, MAXHOSTNAMELEN + 1);
+ return buf;
#else
int a_len = sizeof this->inet_addr_.sin_addr.s_addr;
diff --git a/ace/Log_Msg.cpp b/ace/Log_Msg.cpp
index 8a00060ae67..042a450203f 100644
--- a/ace/Log_Msg.cpp
+++ b/ace/Log_Msg.cpp
@@ -65,37 +65,30 @@ ACE_Log_Msg::instance (void)
{
#if defined (ACE_MT_SAFE)
#if defined (VXWORKS)
-
- // TSS Singleton implementation.
-
+ // TSS Singleton implementation for VxWorks.
static int once_ = 0;
- // this isn't thread safe . . .
+ // This isn't thread safe . . .
if (once_ == 0 && lock_ == 0)
{
// Initialize the static recursive lock here. Note that we
// can't rely on the constructor being called at this point.
ACE_NEW_RETURN (lock_, ACE_Recursive_Thread_Mutex, 0);
-
once_ = 1;
}
- // Get the tss_log_msg from thread-specific storage, using one of the
- // "spare" fields in the task control block. Note that no locks
- // are required here...
+ // Get the tss_log_msg from thread-specific storage, using one of
+ // the "spare" fields in the task control block. Note that no locks
+ // are required here since this is within our thread context...
ACE_Log_Msg **tss_log_msg = (ACE_Log_Msg **) &taskIdCurrent->spare1;
// Check to see if this is the first time in for this thread.
if (*(int **) tss_log_msg == 0)
- {
- // Allocate memory off the heap and store it in a pointer in
- // thread-specific storage (on the stack...).
-
- ACE_NEW_RETURN (*tss_log_msg, ACE_Log_Msg, 0);
- }
+ // Allocate memory off the heap and store it in a pointer in
+ // thread-specific storage (on the stack...).
+ ACE_NEW_RETURN (*tss_log_msg, ACE_Log_Msg, 0);
return *tss_log_msg;
-
#elif !defined (ACE_HAS_THREAD_SPECIFIC_STORAGE)
#error "Platform must support thread-specific storage if threads are used..."
#else
diff --git a/ace/Map_Manager.cpp b/ace/Map_Manager.cpp
index ffa07a3d750..15651326e20 100644
--- a/ace/Map_Manager.cpp
+++ b/ace/Map_Manager.cpp
@@ -134,7 +134,6 @@ ACE_Map_Manager<EXT_ID, INT_ID, LOCK>::resize_i (size_t size)
size_t i;
ACE_Map_Entry<EXT_ID, INT_ID> *temp = (ACE_Map_Entry<EXT_ID, INT_ID> *) ptr;
- ACE_Map_Entry<EXT_ID, INT_ID> *foo;
// Copy over the currently active elements.
for (i = 0; i < this->cur_size_; i++)
@@ -148,8 +147,8 @@ ACE_Map_Manager<EXT_ID, INT_ID, LOCK>::resize_i (size_t size)
for (i = this->cur_size_; i < this->max_size_; i++)
{
- // call the constructor for each element in the array
- foo = new (&(temp[i])) ACE_Map_Entry<EXT_ID, INT_ID>;
+ // Call the constructor for each element in the array.
+ new (&(temp[i])) ACE_Map_Entry<EXT_ID, INT_ID>;
temp[i].is_free_ = 1;
}
diff --git a/ace/OS.cpp b/ace/OS.cpp
index 6e41a8ff33e..b52c155fe99 100644
--- a/ace/OS.cpp
+++ b/ace/OS.cpp
@@ -562,8 +562,8 @@ public:
// Run the thread exit point. This must be an extern "C" to make
// certain compilers happy...
-extern "C"
-void *ace_thread_adapter (void *args)
+extern "C" void *
+ace_thread_adapter (void *args)
{
// ACE_TRACE ("ACE_Thread_Adapter::svc_run");
ACE_Thread_Adapter *thread_args = (ACE_Thread_Adapter *) args;
@@ -592,7 +592,7 @@ void *ace_thread_adapter (void *args)
/* NOTREACHED */
return status;
#else
- return (*func) (arg); // Call thread entry point.
+ return (void *) (*func) (arg); // Call thread entry point.
#endif /* ACE_WIN32 */
}
@@ -841,7 +841,7 @@ ACE_OS::thr_create (ACE_THR_FUNC func,
}
}
- p_thr = (thr_id == 0 ? &tmp_thr : thr_id);
+ p_thr = thr_id == 0 ? &tmp_thr : thr_id;
#if defined (ACE_HAS_SETKIND_NP)
ACE_OSCALL (ACE_ADAPT_RETVAL (::pthread_create (p_thr, attr, func, args),
@@ -894,7 +894,6 @@ ACE_OS::thr_create (ACE_THR_FUNC func,
ACE_Thread_Adapter *thread_args;
ACE_NEW_RETURN (thread_args, ACE_Thread_Adapter (func, args), -1);
-
#if defined (ACE_HAS_MFC)
if (ACE_BIT_ENABLED (flags, THR_USE_AFX))
{
@@ -946,8 +945,9 @@ ACE_OS::thr_create (ACE_THR_FUNC func,
ACE_FAIL_RETURN (-1);
/* NOTREACHED */
#elif defined (VXWORKS)
- // If thr_id points to NULL (or is 0), the call below causes VxWorks
- // to assign a unique task name of the form: "t" + an integer.
+ // If thr_id points to NULL (or is 0), the call below causes
+ // VxWorks to assign a unique task name of the form: "t" + an
+ // integer.
// args must be an array of _exactly_ 10 ints.
@@ -1078,7 +1078,7 @@ ACE_OS::thr_keyfree (ACE_thread_key_t key)
int
ACE_OS::thr_keycreate (ACE_thread_key_t *key,
- void (*dest) (void *),
+ ACE_THR_DEST dest,
void *inst)
{
// ACE_TRACE ("ACE_OS::thr_keycreate");
diff --git a/ace/OS.h b/ace/OS.h
index 89b7fce5630..463e23162d5 100644
--- a/ace/OS.h
+++ b/ace/OS.h
@@ -184,12 +184,6 @@
#endif /* ACE_HAS_ALLOC_HOOKS */
#if defined (VXWORKS)
-#if defined (ghs)
-// horrible hacks to get around inconsistency between ansi and VxWorks
-// stdarg.h with Green Hills 1.8.8 compiler
-#define __INCstdargh
-#include /**/ <stdarg.h>
-#endif /* ghs */
typedef int key_t;
#include /**/ <vxWorks.h>
@@ -891,8 +885,14 @@ typedef void *ACE_MALLOC_T;
#if defined (ACE_HAS_CONSISTENT_SIGNAL_PROTOTYPES)
// Prototypes for both signal() and struct sigaction are consistent..
+#if defined (ACE_HAS_SIG_C_FUNC)
+extern "C" {
+#endif /* ACE_HAS_SIG_C_FUNC */
typedef void (*ACE_SignalHandler)(int);
typedef void (*ACE_SignalHandlerV)(int);
+#if defined (ACE_HAS_SIG_C_FUNC)
+}
+#endif /* ACE_HAS_SIG_C_FUNC */
#elif defined (ACE_HAS_IRIX_53_SIGNALS)
typedef void (*ACE_SignalHandler)(...);
typedef void (*ACE_SignalHandlerV)(...);
@@ -1768,17 +1768,31 @@ union semun
// Create some useful typedefs.
typedef const char **SYS_SIGLIST;
+// This is for C++ static methods.
+#if defined (VXWORKS)
+typedef FUNCPTR ACE_THR_FUNC; // where typedef int (*FUNCPTR) (...)
+#else
typedef void *(*ACE_THR_FUNC)(void *);
+#endif /* VXWORKS */
+
+#if defined (ACE_HAS_THR_C_DEST)
+// Needed for frigging MVS C++...
+extern "C" {
+typedef void (*ACE_THR_DEST)(void *);
+}
+#else
+typedef void (*ACE_THR_DEST)(void *);
+#endif /* ACE_HAS_THR_C_DEST */
extern "C"
{
-#if defined (VXWORKS)
-typedef FUNCPTR ACE_THR_C_FUNC; // where typedef int (*FUNCPTR) (...)
-#elif defined (ACE_WIN32)
+#if defined (ACE_WIN32)
typedef unsigned (__stdcall *ACE_THR_C_FUNC) (void*);
+#elif defined (VXWORKS)
+typedef FUNCPTR ACE_THR_C_FUNC; // where typedef int (*FUNCPTR) (...)
#else
typedef void *(*ACE_THR_C_FUNC)(void *);
-#endif /* ! VXWORKS */
+#endif /* ACE_WIN32 */
}
#if !defined (MAP_FAILED)
@@ -2295,7 +2309,7 @@ public:
static int thr_join (ACE_thread_t waiter_id, ACE_thread_t *thr_id, void **status);
static int thr_keyfree (ACE_thread_key_t key);
static int thr_key_detach (void *inst);
- static int thr_keycreate (ACE_thread_key_t *key, void (*dest)(void *), void *inst = 0);
+ static int thr_keycreate (ACE_thread_key_t *key, ACE_THR_DEST, void *inst = 0);
static int thr_key_used (ACE_thread_key_t key);
static int thr_kill (ACE_thread_t thr_id, int signum);
static size_t thr_min_stack (void);
diff --git a/ace/OS.i b/ace/OS.i
index f877712e511..7fef6bcc600 100644
--- a/ace/OS.i
+++ b/ace/OS.i
@@ -137,9 +137,9 @@ extern "C" char *mktemp (char *);
#if defined (ACE_HAS_THR_C_FUNC)
// 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));
+#define ACE_PTHREAD_CLEANUP_PUSH(A) pthread_cleanup_push (ace_mutex_lock_cleanup_adapter, (void *) A);
#else
-#define ACE_PTHREAD_CLEANUP_PUSH(A) pthread_cleanup_push (ACE_OS::mutex_lock_cleanup, (void *) A));
+#define ACE_PTHREAD_CLEANUP_PUSH(A) pthread_cleanup_push (ACE_OS::mutex_lock_cleanup, (void *) A);
#endif /* ACE_HAS_THR_C_FUNC */
#if defined (ACE_HAS_REGEX)
@@ -2450,7 +2450,10 @@ ACE_OS::gethostbyname_r (const char *name, hostent *result,
#if defined (VXWORKS)
ACE_NOTSUP_RETURN (0);
#elif defined (ACE_HAS_REENTRANT_FUNCTIONS) && defined (ACE_MT_SAFE) && !defined (UNIXWARE)
-#if defined (AIX) || defined (DIGITAL_UNIX)
+#if defined (DIGITAL_UNIX)
+ // gethostbyname returns thread-specific storage on Digital Unix
+ ACE_SOCKCALL_RETURN (::gethostbyname (name), struct hostent *, 0);
+#elif defined (AIX)
::memset (buffer, 0, sizeof (ACE_HOSTENT_DATA));
if (::gethostbyname_r (name, result, (struct hostent_data *) buffer) == 0)
@@ -3212,10 +3215,10 @@ ACE_OS::thr_sigsetmask (int how,
ACE_NOTSUP_RETURN (-1);
#elif defined (ACE_HAS_PTHREADS_1003_DOT_1C)
// PTHREADS_1003_DOT_1C is NOT a subcase of DCETHREADS!
- ACE_OSCALL_RETURN (ACE_ADAPT_RETVAL (::sigthreadmask (how, nsm, osm),
+ ACE_OSCALL_RETURN (ACE_ADAPT_RETVAL (::pthread_sigmask (how, nsm, osm),
ace_result_), int, -1);
#elif defined (ACE_HAS_PTHREADS) && !defined (ACE_HAS_FSU_PTHREADS)
-#if defined (ACE_HAS_IRIX62_THREADS) || defined (DIGITAL_UNIX)
+#if defined (ACE_HAS_IRIX62_THREADS)
ACE_OSCALL_RETURN (ACE_ADAPT_RETVAL (::pthread_sigmask (how, nsm, osm),
ace_result_),int, -1);
#else
@@ -3266,11 +3269,10 @@ ACE_OS::thr_min_stack (void)
#elif (defined (ACE_HAS_DCETHREADS) || defined (ACE_HAS_PTHREADS)) && !defined (ACE_HAS_SETKIND_NP)
#if defined (ACE_HAS_IRIX62_THREADS)
return (size_t) ACE_OS::sysconf (_SC_THREAD_STACK_MIN);
-#if defined (PTHREAD_STACK_MIN)
+#elif defined (PTHREAD_STACK_MIN)
return PTHREAD_STACK_MIN;
#else
ACE_NOTSUP_RETURN (0);
-#endif /* PTHREAD_STACK_MIN */
#endif /* ACE_HAS_IRIX62_THREADS */
#elif (defined (ACE_HAS_DCETHREADS) || defined (ACE_HAS_PTHREADS)) && !defined (ACE_HAS_SETKIND_NP)
ACE_NOTSUP_RETURN (0);
@@ -4658,7 +4660,7 @@ ACE_OS::asctime_r (const struct tm *t, char *buf, int buflen)
#endif /* ACE_HAS_ONLY_TWO_PARAMS_FOR_ASCTIME_R_AND_CTIME_R */
#else
char *result;
- ACE_OSCALL_RETURN (::asctime (t), char *, 0);
+ ACE_OSCALL (::asctime (t), char *, 0, result);
::strncpy (buf, result, buflen);
return buf;
#endif /* defined (ACE_HAS_REENTRANT_FUNCTIONS) && defined (ACE_MT_SAFE) */
@@ -5235,6 +5237,8 @@ ACE_OS::mkdir (const char *path, mode_t mode)
// ACE_TRACE ("ACE_OS::mkdir");
#if defined (ACE_WIN32)
ACE_OSCALL_RETURN (::_mkdir (path), int, -1);
+#elif defined (VXWORKS)
+ ACE_OSCALL_RETURN (::_mkdir ((char *) path), int, -1);
#else
ACE_OSCALL_RETURN (::mkdir (path, mode), int, -1);
#endif /* VXWORKS */
diff --git a/ace/Pipe.cpp b/ace/Pipe.cpp
index 027ba172c92..8101c915453 100644
--- a/ace/Pipe.cpp
+++ b/ace/Pipe.cpp
@@ -39,9 +39,8 @@ ACE_Pipe::open (void)
{
ACE_INET_Addr sv_addr (my_addr.get_port_number (), "localhost");
- // Establish a connection within the same process, make sure to
- // enable the "reuse addr" flag.
- if (connector.connect (writer, sv_addr, 0, ACE_Addr::sap_any, 1) == -1)
+ // Establish a connection within the same process.
+ if (connector.connect (writer, sv_addr) == -1)
result = -1;
else if (acceptor.accept (reader) == -1)
{
@@ -50,6 +49,7 @@ ACE_Pipe::open (void)
}
}
+#if !defined (VXWORKS)
int one = 1;
// Make sure that the TCP stack doesn't try to buffer small writes.
// Since this communication is purely local to the host it doesn't
@@ -57,6 +57,7 @@ ACE_Pipe::open (void)
if (writer.set_option (IPPROTO_TCP, TCP_NODELAY,
&one, sizeof one) == -1)
return -1;
+#endif /* !VXWORKS */
// Close down the acceptor endpoint since we don't need it anymore.
acceptor.close ();
diff --git a/ace/README b/ace/README
index 9b3ca25721c..fbcca13ce6f 100644
--- a/ace/README
+++ b/ace/README
@@ -73,6 +73,7 @@ ACE_HAS_SIGINFO_T Platform supports SVR4 extended signals
ACE_HAS_SIGNAL_SAFE_OS_CALLS Automatically restart OS system calls when EINTR occurs
ACE_HAS_SIGWAIT Platform/compiler has the sigwait(2) prototype
ACE_HAS_SIG_ATOMIC_T Compiler/platform defines the sig_atomic_t typedef
+ACE_HAS_SIG_C_FUNC Compiler requires extern "C" functions for signals.
ACE_HAS_SIN_LEN Platform supports new BSD inet_addr len field.
ACE_HAS_SIZET_SOCKET_LEN OS/compiler uses size_t * rather than int * for socket lengths
ACE_HAS_SOCKIO_H Compiler/platform provides the sockio.h file
@@ -107,6 +108,7 @@ ACE_HAS_TEMPLATE_TYPEDEFS Compiler implements templates that support typedefs i
ACE_HAS_TERM_IOCTLS Platform has terminal ioctl flags like TCGETS and TCSETS.
ACE_HAS_THREADS Platform supports threads
ACE_HAS_THREAD_SPECIFIC_STORAGE Compiler/platform has thread-specific storage
+ACE_HAS_THR_C_DEST The pthread_keycreate() routine *must* take extern C functions.
ACE_HAS_THR_C_FUNC The pthread_create() routine *must* take extern C functions.
ACE_HAS_TID_T Platform supports the tid_t type (e.g., AIX)
ACE_HAS_TIMEZONE_GETTIMEOFDAY Platform/compiler supports timezone * as second parameter to gettimeofday()
diff --git a/ace/Reactor.cpp b/ace/Reactor.cpp
index 214ed466c93..3572ffea70f 100644
--- a/ace/Reactor.cpp
+++ b/ace/Reactor.cpp
@@ -859,6 +859,13 @@ ACE_Reactor::open (size_t size,
this->delete_signal_handler_ = 0;
}
+ // We do this first in case the handler_rep_ call fails (which it
+ // sometimes does on Win32 when we restart applications quickly due
+ // to the use of sockets as a notification mechanism). At least
+ // this way the timer_queue_ isn't 0, so we can still use the
+ // Reactor as a timer...
+ ACE_NEW_RETURN (this->timer_queue_, ACE_Timer_Queue, -1);
+
if (this->handler_rep_.open (size) == -1)
return -1;
#if defined (ACE_MT_SAFE)
@@ -870,8 +877,6 @@ ACE_Reactor::open (size_t size,
}
#endif /* ACE_MT_SAFE */
- ACE_NEW_RETURN (this->timer_queue_, ACE_Timer_Queue, -1);
-
#if defined (ACE_USE_POLL)
ACE_NEW_RETURN (this->poll_h_, pollfd[size], -1);
diff --git a/ace/Reactor.h b/ace/Reactor.h
index fe178877950..87de350c5b0 100644
--- a/ace/Reactor.h
+++ b/ace/Reactor.h
@@ -1,7 +1,6 @@
/* -*- C++ -*- */
// $Id$
-
// ============================================================================
//
// = LIBRARY
diff --git a/ace/Service_Main.cpp b/ace/Service_Main.cpp
index cf20fe799e8..f6d4ea1a4df 100644
--- a/ace/Service_Main.cpp
+++ b/ace/Service_Main.cpp
@@ -1,37 +1,33 @@
// Service_Main.cpp
// $Id$
-/* This is an example of a canonical Service Configurator daemon's
- main() function. Note how this driver file is completely generic
- and may be used to configure almost any type of network daemon. */
+// This is an example of a canonical Service Configurator daemon's
+// main() function. Note how this driver file is completely generic
+// and may be used to configure almost any type of network daemon.
#define ACE_BUILD_DLL
#include "ace/Service_Config.h"
-sig_atomic_t finished = 0;
-
-static void
-handler (int)
-{
- ACE_TRACE ("handler");
- finished = 1;
-}
-
int
sc_main (int argc, char *argv[])
{
ACE_TRACE ("sc_main");
ACE_Service_Config daemon;
- ACE_OS::signal (SIGINT, ACE_SignalHandler (handler));
-
if (daemon.open (argc, argv) == -1)
ACE_ERROR ((LM_ERROR, "%p\n%a", "open", 1));
- /* Run forever, performing the configured services. */
+ // Create an adapter to end the event loop.
+ ACE_Sig_Adapter sa (ACE_Sig_Handler_Ex (ACE_Service_Config::end_reactor_event_loop));
+
+ // Register a signal handler.
+ ACE_Service_Config::reactor ()->register_handler (SIGINT, sa);
+
+ // Run forever, performing the configured services until we are shut
+ // down by a SIGINT/SIGQUIT signal.
- while (!finished)
- daemon.run_reactor_event_loop ();
+ while (server_test.reactor_event_loop_done () == 0)
+ server_test.run_reactor_event_loop ();
return 0;
}
diff --git a/ace/Signal.cpp b/ace/Signal.cpp
index 8232c639e72..2354ec34a19 100644
--- a/ace/Signal.cpp
+++ b/ace/Signal.cpp
@@ -11,6 +11,26 @@
// Static definitions.
+#if defined (ACE_HAS_SIG_C_FUNC)
+extern "C" void
+ace_signal_handler_dispatch (int signum, siginfo_t *info, ucontext_t *context)
+{
+ ACE_TRACE ("ace_signal_handler_dispatch");
+ ACE_Sig_Handler::dispatch (signum, info, context);
+}
+
+extern "C" void
+ace_signal_handlers_dispatch (int, siginfo_t *, ucontext_t *)
+{
+ ACE_TRACE ("ace_signal_handlers_dispatch");
+ ACE_Sig_Handlers::dispatch (signum, info, context);
+}
+
+static ACE_SignalHandler ace_dispatcher = ACE_SignalHandler (ace_signal_handlers_dispatch);
+#else
+static ACE_SignalHandler ace_dispatcher = ACE_SignalHandler (ACE_Sig_Handler::dispatch);
+#endif /* ACE_HAS_SIG_C_FUNC */
+
#if defined (ACE_MT_SAFE)
ACE_Recursive_Thread_Mutex ACE_Sig_Handler::ace_sig_handler_lock_;
#endif /* ACE_MT_SAFE */
@@ -165,7 +185,7 @@ ACE_Sig_Handler::register_handler (int signum,
if (new_disp == 0)
new_disp = &sa;
- new_disp->handler (ACE_SignalHandler (ACE_Sig_Handler::dispatch));
+ new_disp->handler (ace_dispatcher);
new_disp->flags (new_disp->flags () | SA_SIGINFO);
return new_disp->register_action (signum, old_disp);
}
@@ -388,7 +408,7 @@ ACE_Sig_Handlers::register_handler (int signum,
// Check whether we are already in control of the signal
// handling disposition...
- if (!(sa.handler () == ACE_SignalHandler (ACE_Sig_Handlers::dispatch)
+ if (!(sa.handler () == ace_dispatcher
|| sa.handler () == ACE_SignalHandler (SIG_IGN)
|| sa.handler () == ACE_SignalHandler (SIG_DFL)))
{
@@ -437,7 +457,7 @@ ACE_Sig_Handlers::register_handler (int signum,
return -1;
}
// If ACE_Sig_Handler::dispatch() was set we're done.
- else if (sa.handler () == ACE_SignalHandler (ACE_Sig_Handlers::dispatch))
+ else if (sa.handler () == ace_dispatcher)
return ace_sig_adapter->sigkey ();
// Otherwise, we need to register our handler function so that
@@ -449,7 +469,7 @@ ACE_Sig_Handlers::register_handler (int signum,
if (new_disp == 0)
new_disp = &sa;
- new_disp->handler (ACE_SignalHandler (ACE_Sig_Handlers::dispatch));
+ new_disp->handler (ace_dispatcher);
// Default is to restart signal handlers.
new_disp->flags (new_disp->flags () | SA_RESTART);
diff --git a/ace/Signal.h b/ace/Signal.h
index e12b18fdc1e..f627bd73222 100644
--- a/ace/Signal.h
+++ b/ace/Signal.h
@@ -199,6 +199,11 @@ public:
// Set a new <ACE_Event_Handler> that is associated with <signum>.
// Return the existing handler.
+ static void dispatch (int, siginfo_t *, ucontext_t *);
+ // Callback routine registered with sigaction(2) that dispatches the
+ // handle_signal() method of the appropriate pre-registered
+ // ACE_Event_Handler.
+
void dump (void) const;
// Dump the state of an object.
@@ -219,11 +224,6 @@ protected:
#endif /* ACE_MT_SAFE */
private:
- static void dispatch (int, siginfo_t *, ucontext_t *);
- // Callback routine registered with sigaction(2) that dispatches the
- // handle_signal() method of the appropriate pre-registered
- // ACE_Event_Handler.
-
static ACE_Event_Handler *signal_handlers_[NSIG];
// Array used to store one user-defined Event_Handler for every
// signal.
@@ -319,6 +319,11 @@ public:
// head of the list of signals. Return the existing handler that
// was at the head.
+ static void dispatch (int signum, siginfo_t *, ucontext_t *);
+ // Callback routine registered with sigaction(2) that dispatches the
+ // handle_signal() method of all the pre-registered
+ // ACE_Event_Handlers for <signum>
+
void dump (void) const;
// Dump the state of an object.
@@ -326,11 +331,6 @@ public:
// Declare the dynamic allocation hooks.
private:
- static void dispatch (int signum, siginfo_t *, ucontext_t *);
- // Callback routine registered with sigaction(2) that dispatches the
- // handle_signal() method of all the pre-registered
- // ACE_Event_Handlers for <signum>
-
static int sigkey_;
// Keeps track of the id that uniquely identifies each registered
// signal handler. This id can be used to cancel a timer via the
diff --git a/ace/Thread.h b/ace/Thread.h
index 4880b824f8e..02f8f1d8e46 100644
--- a/ace/Thread.h
+++ b/ace/Thread.h
@@ -119,7 +119,7 @@ public:
// Change and/or examine calling thread's signal mask.
static int keycreate (ACE_thread_key_t *keyp,
- void (*destructor)(void *value),
+ ACE_THR_DEST destructor,
void * = 0);
// Allocates a <keyp> that is used to identify data that is specific
// to each thread in the process. The key is global to all threads
diff --git a/ace/Thread.i b/ace/Thread.i
index 88d2b1bfcf2..f22927e171c 100644
--- a/ace/Thread.i
+++ b/ace/Thread.i
@@ -9,7 +9,7 @@
ACE_INLINE int
ACE_Thread::keycreate (ACE_thread_key_t *keyp,
- void (*destructor)(void *value),
+ ACE_THR_DEST destructor,
void *inst)
{
ACE_TRACE ("ACE_Thread::keycreate");
diff --git a/ace/Thread_Manager.i b/ace/Thread_Manager.i
index a2cbc04b53c..5cb1444d5b4 100644
--- a/ace/Thread_Manager.i
+++ b/ace/Thread_Manager.i
@@ -74,7 +74,7 @@ ACE_Thread_Control::thr_mgr (ACE_Thread_Manager *tm)
{
ACE_TRACE ("ACE_Thread_Control::thr_mgr");
ACE_Thread_Manager *o_tm = this->tm_;
- return this->tm_ = tm;
+ this->tm_ = tm;
return o_tm;
}
diff --git a/ace/Time_Request_Reply.cpp b/ace/Time_Request_Reply.cpp
index 46bce6553c6..2234e960d22 100644
--- a/ace/Time_Request_Reply.cpp
+++ b/ace/Time_Request_Reply.cpp
@@ -103,7 +103,7 @@ ACE_Time_Request::timeout (const ACE_Time_Value timeout)
}
// = Set/get the time
-const ACE_UINT32
+ACE_UINT32
ACE_Time_Request::time (void) const
{
ACE_TRACE ("ACE_Time_Request::time");
@@ -111,7 +111,7 @@ ACE_Time_Request::time (void) const
}
void
-ACE_Time_Request::time (const ACE_UINT32 t)
+ACE_Time_Request::time (ACE_UINT32 t)
{
ACE_TRACE ("ACE_Time_Request::time");
this->time_ = t;
diff --git a/ace/Time_Request_Reply.h b/ace/Time_Request_Reply.h
index 7bd3219d6e7..ce78fe3b0cc 100644
--- a/ace/Time_Request_Reply.h
+++ b/ace/Time_Request_Reply.h
@@ -64,8 +64,8 @@ public:
void msg_type (ACE_UINT32);
// = Set/get the time
- const ACE_UINT32 time (void) const;
- void time (const ACE_UINT32 t);
+ ACE_UINT32 time (void) const;
+ void time (ACE_UINT32 t);
// = Set/get the blocking semantics.
ACE_UINT32 block_forever (void) const;
diff --git a/ace/UPIPE_Stream.cpp b/ace/UPIPE_Stream.cpp
index 8f1b29a8596..b5fba065f27 100644
--- a/ace/UPIPE_Stream.cpp
+++ b/ace/UPIPE_Stream.cpp
@@ -92,7 +92,7 @@ ACE_UPIPE_Stream::send (const char *buffer,
ACE_NEW_RETURN (mb_p, ACE_Message_Block (n), -1);
mb_p->copy (buffer, n);
- return this->stream_.put (mb_p, timeout) == -1 ? -1 : n;
+ return this->stream_.put (mb_p, timeout) == -1 ? -1 : (int) n;
}
// Receive a buffer.
diff --git a/ace/config-mvs.h b/ace/config-mvs.h
index c2eb04ab54f..506f35a03a3 100644
--- a/ace/config-mvs.h
+++ b/ace/config-mvs.h
@@ -16,6 +16,9 @@
// Compiler/platform uses macro for ctime
#define ACE_HAS_BROKEN_CTIME
+// Compiler requires extern "C" functions for signals.
+#define ACE_HAS_SIG_C_FUNC
+
// Prototypes for both signal() and struct sigaction are consistent.
#define ACE_HAS_CONSISTENT_SIGNAL_PROTOTYPES
@@ -28,6 +31,9 @@
// The pthread_create() routine *must* take extern C functions.
#define ACE_HAS_THR_C_FUNC
+// The pthread_keycreate() routine *must* take extern C functions.
+#define ACE_HAS_THR_C_DEST
+
// The rusage_t structure has only two fields
#define ACE_HAS_LIMITED_RUSAGE_T