summaryrefslogtreecommitdiff
path: root/ace
diff options
context:
space:
mode:
authorschmidt <douglascraigschmidt@users.noreply.github.com>1996-12-10 08:49:56 +0000
committerschmidt <douglascraigschmidt@users.noreply.github.com>1996-12-10 08:49:56 +0000
commit33654cd7e725a0f8069b1bcdbc3f48437b364796 (patch)
treeff947ccd272b645b872902a961c0907b7f974469 /ace
parent86936cd3534f0e229df709e544f0214451bf1c69 (diff)
downloadATCD-33654cd7e725a0f8069b1bcdbc3f48437b364796.tar.gz
eon
Diffstat (limited to 'ace')
-rw-r--r--ace/ACE.cpp140
-rw-r--r--ace/ACE.h2
-rw-r--r--ace/INET_Addr.cpp4
-rw-r--r--ace/LSOCK_Stream.cpp7
-rw-r--r--ace/LSOCK_Stream.h5
-rw-r--r--ace/Local_Tokens.h5
-rw-r--r--ace/Memory_Pool.cpp10
-rw-r--r--ace/Memory_Pool.h2
-rw-r--r--ace/Message_Queue.cpp10
-rw-r--r--ace/Message_Queue.h5
-rw-r--r--ace/Module.cpp3
-rw-r--r--ace/OS.h6
-rw-r--r--ace/OS.i18
-rw-r--r--ace/Reactor.cpp5
-rw-r--r--ace/ReactorEx.cpp4
-rw-r--r--ace/Service_Config.cpp12
-rw-r--r--ace/Service_Config.h7
-rw-r--r--ace/Thread.h7
18 files changed, 185 insertions, 67 deletions
diff --git a/ace/ACE.cpp b/ace/ACE.cpp
index 1a99e4ef648..2c3fd9eea37 100644
--- a/ace/ACE.cpp
+++ b/ace/ACE.cpp
@@ -107,52 +107,116 @@ ACE::strenvdup (const char *str)
return ACE_OS::strdup (str);
}
+/*
+
+Examples:
+Source NT UNIX
+===============================================================
+netsvc netsvc.dll libnetsvc.so
+ (PATH will be evaluated) (LD_LIBRARY_PATH evaluated)
+
+libnetsvc.dll libnetsvc.dll libnetsvc.dll + warning
+netsvc.so netsvc.so + warning libnetsvc.so
+
+..\../libs/netsvc ..\..\libs\netsvc.dll ../../libs/libnetsvc.so
+ (absolute path used) (absolute path used)
+
+*/
+
int
ACE::ldfind (const char *filename,
- char *pathname,
+ char *pathname,
size_t maxlen)
{
ACE_TRACE ("ACE::ldfind");
+ char tempcopy[MAXPATHLEN];
+ char searchpathname[MAXPATHLEN];
+ char tempfilename[MAXPATHLEN];
char searchfilename[MAXPATHLEN];
- // Determine, whether the default-suffix for shared libraries needs
- // to be appended.
+ // Create a working copy of filename to mess with
+ if (ACE_OS::strlen (filename) + 1 > sizeof tempcopy)
+ {
+ errno = ENOMEM;
+ return -1;
+ }
+ else
+ ACE_OS::strcpy (tempcopy, filename);
- if (ACE_OS::strstr (filename, ACE_DLL_SUFFIX) != 0)
- // Use the filename as provided since it has a suffix.
- ACE_OS::strncpy (searchfilename, filename, sizeof searchfilename);
+ // Insert canonical directory separators
+ char *separator_ptr;
+
+ for (separator_ptr = tempcopy; *separator_ptr != '\0'; separator_ptr++)
+ if (*separator_ptr == '\\'
+ || *separator_ptr == ACE_DIRECTORY_SEPARATOR_CHAR)
+ *separator_ptr = '/';
+
+ separator_ptr = ACE_OS::strrchr (tempcopy, '/');
+ // Separate filename from pathname
+
+ if (separator_ptr != NULL)
+ {
+ ACE_OS::strcpy (tempfilename, separator_ptr + 1);
+ separator_ptr[1] = '\0';
+ ACE_OS::strcpy (searchpathname, tempcopy);
+ }
else
{
- if (ACE_OS::strlen (filename)
- + ACE_OS::strlen (ACE_DLL_SUFFIX)
- + 1 >= sizeof searchfilename)
- {
- errno = ENOMEM;
- return -1;
- }
- else
- ::sprintf (searchfilename, "%s%s", filename, ACE_DLL_SUFFIX);
+ searchpathname[0] = '\0';
+ ACE_OS::strcpy (tempfilename, tempcopy);
}
- if (ACE_OS::strcmp (searchfilename
- + ACE_OS::strlen (searchfilename) - ACE_OS::strlen (ACE_DLL_SUFFIX),
+ // Determine, how the filename needs to be decorated.
+
+ int got_prefix = 0;
+ int got_suffix = 0;
+
+ if (ACE_OS::strchr (tempfilename, '.') != NULL)
+ got_suffix = -1;
+
+ if (ACE_OS::strlen(ACE_DLL_PREFIX) == 0
+ || (ACE_OS::strncmp(tempfilename, ACE_DLL_PREFIX,
+ ACE_OS::strlen(ACE_DLL_PREFIX) == 0)))
+ got_prefix = -1;
+
+ // Create the properly decorated filename
+ if (ACE_OS::strlen (tempfilename) +
+ (got_prefix) ? 0 : ACE_OS::strlen(ACE_DLL_PREFIX) +
+ (got_suffix) ? 0 : ACE_OS::strlen (ACE_DLL_SUFFIX) >= sizeof searchfilename)
+ {
+ errno = ENOMEM;
+ return -1;
+ }
+ else
+ ::sprintf (searchfilename, "%s%s%s",
+ (got_prefix) ? "" : ACE_DLL_PREFIX,
+ tempfilename,
+ (got_suffix) ? "" : ACE_DLL_SUFFIX);
+
+ if (ACE_OS::strcmp (searchfilename + 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",
searchfilename));
- if (ACE_OS::strchr (searchfilename, ACE_DIRECTORY_SEPARATOR_CHAR) != 0)
+ if (ACE_OS::strlen (searchpathname) > 0)
{
// Use absolute pathname.
- if (ACE_OS::strlen (searchfilename) >= maxlen)
+ if (ACE_OS::strlen (searchfilename) + ACE_OS::strlen (searchpathname) >= maxlen)
{
errno = ENOMEM;
return -1;
}
else
{
- ACE_OS::strncpy (pathname, searchfilename, maxlen);
+
+ // Revert to native path name separators
+ for (separator_ptr = searchpathname; *separator_ptr != '\0'; separator_ptr++)
+ if (*separator_ptr == '/')
+ *separator_ptr = ACE_DIRECTORY_SEPARATOR_CHAR;
+
+ ::sprintf (pathname, "%s%s", searchpathname, searchfilename);
return 0;
}
}
@@ -171,7 +235,8 @@ ACE::ldfind (const char *filename,
while (path_entry != 0)
{
- if (ACE_OS::strlen (path_entry) + 1 + ACE_OS::strlen (searchfilename) >= maxlen)
+ if (ACE_OS::strlen (path_entry) + 1 + ACE_OS::strlen
+ (searchfilename) >= maxlen)
{
errno = ENOMEM;
result = -1;
@@ -184,7 +249,8 @@ ACE::ldfind (const char *filename,
if (ACE_OS::access (pathname, R_OK) == 0)
break;
- path_entry = ACE_OS::strtok (0, ACE_LD_SEARCH_PATH_SEPARATOR_STR);
+ path_entry = ACE_OS::strtok (0,
+ ACE_LD_SEARCH_PATH_SEPARATOR_STR);
}
ACE_OS::free ((void *) ld_path);
@@ -713,23 +779,36 @@ ACE::bind_port (ACE_HANDLE handle)
// code from APUE.
int
-ACE::daemonize (void)
+ACE::daemonize (const char pathname[])
{
ACE_TRACE ("ACE::daemonize");
#if !defined (ACE_WIN32)
- pid_t pid;
+ pid_t pid = ACE_OS::fork ();
- if ((pid = ACE_OS::fork ()) == -1)
+ if (pid == -1)
return -1;
else if (pid != 0)
- ACE_OS::exit (0); /* parent exits */
+ ACE_OS::exit (0); // Parent exits.
+
+ // 1st child continues.
+ ACE_OS::setsid (); // Become session leader.
+
+ ACE_OS::signal (SIGHUP, SIG_IGN);
+
+ pid = ACE_OS::fork ();
+
+ if (pid != 0)
+ ACE_OS::exit (0); // First child terminates.
+
+ // Second child continues.
- /* child continues */
- ACE_OS::setsid (); /* become session leader */
+ ACE_OS::chdir (pathname); // change working directory.
- ACE_OS::chdir ("/"); /* change working directory */
+ ACE_OS::umask (0); // clear our file mode creation mask.
- ACE_OS::umask (0); /* clear our file mode creation mask */
+ // Close down the files.
+ for (int i = ACE::max_handles () - 1; i >= 0; i--)
+ ACE_OS::close (i);
return 0;
#else
ACE_NOTSUP_RETURN (-1);
@@ -872,6 +951,7 @@ ACE::send (ACE_HANDLE handle,
const ACE_Time_Value *tv)
{
if (tv == 0)
+ // Use the blocking send.
return ACE::send (handle, buf, n, flags);
else
{
diff --git a/ace/ACE.h b/ace/ACE.h
index b6d095972f6..0263b92fded 100644
--- a/ace/ACE.h
+++ b/ace/ACE.h
@@ -243,7 +243,7 @@ public:
// 0 if unsuccessful, else returns pointer to beginning of the
// "time" portion of <day_and_time>.
- static int daemonize (void);
+ static int daemonize (const char pathname[] = "/");
// Become a daemon process.
// = Methods for searching and opening shared libraries using relative naming.
diff --git a/ace/INET_Addr.cpp b/ace/INET_Addr.cpp
index 18d17b1dd38..9cc37738029 100644
--- a/ace/INET_Addr.cpp
+++ b/ace/INET_Addr.cpp
@@ -181,9 +181,7 @@ ACE_INET_Addr::set (u_short port_number,
errno = EINVAL;
return -1;
}
- else if ((addr = ACE_OS::inet_addr (host_name)) != (ACE_UINT32) -1
- // Broadcast addresses are weird...
- || ACE_OS::strcmp (host_name, "255.255.255.255") == 0)
+ else if (ACE_OS::inet_aton (host_name, (struct in_addr *) &addr) == 1)
return this->set (port_number, encode ? ntohl (addr) : addr, encode);
else
diff --git a/ace/LSOCK_Stream.cpp b/ace/LSOCK_Stream.cpp
index e79927e3100..bcfe6a60d73 100644
--- a/ace/LSOCK_Stream.cpp
+++ b/ace/LSOCK_Stream.cpp
@@ -8,6 +8,13 @@
ACE_ALLOC_HOOK_DEFINE(ACE_LSOCK_Stream)
+int
+ACE_LSOCK_Stream::get_remote_addr (ACE_Addr &a) const
+{
+ ACE_TRACE ("ACE_LSOCK_Stream::get_remote_addr");
+ return this->get_local_addr (a);
+}
+
void
ACE_LSOCK_Stream::dump (void) const
{
diff --git a/ace/LSOCK_Stream.h b/ace/LSOCK_Stream.h
index be37419b15b..ac8448fc13d 100644
--- a/ace/LSOCK_Stream.h
+++ b/ace/LSOCK_Stream.h
@@ -37,6 +37,7 @@ public:
ACE_HANDLE get_handle (void) const;
// Get handle.
+
void set_handle (ACE_HANDLE fd);
// Overrides set_handle from the base classes.
@@ -46,9 +47,9 @@ public:
ACE_ALLOC_HOOK_DECLARE;
// Declare the dynamic allocation hooks.
-private:
int get_remote_addr (ACE_Addr &) const;
- // Do not allow this function to percolate up to this interface...
+ // This method simply returns the "local" addr (since they are the
+ // same for UNIX domain sockets).
};
#include "ace/LSOCK_Stream.i"
diff --git a/ace/Local_Tokens.h b/ace/Local_Tokens.h
index 177de5515fd..e4ebe99a2b6 100644
--- a/ace/Local_Tokens.h
+++ b/ace/Local_Tokens.h
@@ -1,7 +1,6 @@
/* -*- C++ -*- */
// $Id$
-
// ============================================================================
//
// = LIBRARY
@@ -68,6 +67,7 @@ public:
#endif /* ACE_HAS_THREADS */
};
+// Forward decl.
class ACE_Token_Proxy;
// 3..
@@ -337,8 +337,7 @@ public:
// = Accessor methods.
- typedef ACE_Unbounded_Stack<ACE_TPQ_Entry *>
- OWNER_STACK;
+ typedef ACE_Unbounded_Stack<ACE_TPQ_Entry *> OWNER_STACK;
// Stack of owners.
virtual int owners (OWNER_STACK &o, const char *id) = 0;
diff --git a/ace/Memory_Pool.cpp b/ace/Memory_Pool.cpp
index cf28cd28656..45508fc8d21 100644
--- a/ace/Memory_Pool.cpp
+++ b/ace/Memory_Pool.cpp
@@ -406,7 +406,7 @@ ACE_Shared_Memory_Pool::dump (void) const
int
ACE_Shared_Memory_Pool::in_use (off_t &offset,
- int &counter)
+ size_t &counter)
{
offset = 0;
SHM_TABLE *st = (SHM_TABLE *) this->base_addr_;
@@ -431,7 +431,7 @@ ACE_Shared_Memory_Pool::commit_backing_store_name (size_t rounded_bytes,
off_t &offset)
{
ACE_TRACE ("ACE_Shared_Memory_Pool::update");
- int counter;
+ size_t counter;
SHM_TABLE *st = (SHM_TABLE *) this->base_addr_;
if (this->in_use (offset, counter) == -1)
@@ -478,7 +478,7 @@ ACE_Shared_Memory_Pool::handle_signal (int , siginfo_t *siginfo, ucontext_t *)
if (siginfo != 0)
{
// ACE_DEBUG ((LM_DEBUG, "(%P|%t) si_signo = %d, si_code = %d, addr = %u\n", siginfo->si_signo, siginfo->si_code, siginfo->si_addr));
- int counter;
+ size_t counter;
if (this->in_use (offset, counter) == -1)
ACE_ERROR ((LM_ERROR, "(%P|%t) %p\n", "in_use"));
else if (!(siginfo->si_code == SEGV_MAPERR
@@ -549,7 +549,7 @@ ACE_Shared_Memory_Pool::init_acquire (size_t nbytes,
{
ACE_TRACE ("ACE_Shared_Memory_Pool::init_acquire");
- int counter;
+ size_t counter;
off_t shm_table_offset = ACE::round_to_pagesize (sizeof (SHM_TABLE));
rounded_bytes = this->round_up (nbytes);
@@ -618,7 +618,7 @@ ACE_Shared_Memory_Pool::release (void)
int result = 0;
SHM_TABLE *st = (SHM_TABLE *) this->base_addr_;
- for (int counter = 0;
+ for (size_t counter = 0;
counter < this->max_segments_ && st[counter].used_ == 1;
counter++)
if (ACE_OS::shmctl (st[counter].shmid_, IPC_RMID, NULL) == -1)
diff --git a/ace/Memory_Pool.h b/ace/Memory_Pool.h
index 22f26c129cf..537afd220f7 100644
--- a/ace/Memory_Pool.h
+++ b/ace/Memory_Pool.h
@@ -207,7 +207,7 @@ protected:
key_t base_shm_key_;
// Base shared memory key for the segment.
- virtual int in_use (off_t &offset, int &counter);
+ virtual int in_use (off_t &offset, size_t &counter);
// Determine how much memory is currently in use.
ACE_Sig_Handler signal_handler_;
diff --git a/ace/Message_Queue.cpp b/ace/Message_Queue.cpp
index 85967ce42ce..bb3980bffdb 100644
--- a/ace/Message_Queue.cpp
+++ b/ace/Message_Queue.cpp
@@ -419,7 +419,7 @@ template <ACE_SYNCH_1> int
ACE_Message_Queue<ACE_SYNCH_2>::enqueue_prio (ACE_Message_Block *new_item,
ACE_Time_Value *tv)
{
- ACE_TRACE ("ACE_Message_Queue<ACE_SYNCH_2>::enqueue");
+ ACE_TRACE ("ACE_Message_Queue<ACE_SYNCH_2>::enqueue_prio");
int queue_count;
@@ -460,6 +460,14 @@ ACE_Message_Queue<ACE_SYNCH_2>::enqueue_prio (ACE_Message_Block *new_item,
}
}
+template <ACE_SYNCH_1> int
+ACE_Message_Queue<ACE_SYNCH_2>::enqueue (ACE_Message_Block *new_item,
+ ACE_Time_Value *tv)
+{
+ ACE_TRACE ("ACE_Message_Queue<ACE_SYNCH_2>::enqueue");
+ return this->enqueue_prio (new_item, tv);
+}
+
// Block indefinitely waiting for an item to arrive,
// does not ignore alerts (e.g., signals).
diff --git a/ace/Message_Queue.h b/ace/Message_Queue.h
index 31710fdaef8..3be9699395c 100644
--- a/ace/Message_Queue.h
+++ b/ace/Message_Queue.h
@@ -95,6 +95,11 @@ public:
// inserted consecutively. Returns -1 on failure, else the number
// of items still on the queue.
+ int enqueue (ACE_Message_Block *new_item, ACE_Time_Value *tv = 0);
+ // This is an alias for <enqueue_prio>. It's only here for
+ // backwards compatibility and will go away in a subsequent release.
+ // Please use <enqueue_prio> instead.
+
int enqueue_tail (ACE_Message_Block *new_item, ACE_Time_Value *tv = 0);
// Enqueue an <ACE_Message_Block *> at the end of the queue.
// Returns -1 on failure, else the number of items still on the
diff --git a/ace/Module.cpp b/ace/Module.cpp
index eefac725ae7..90fe094ce9c 100644
--- a/ace/Module.cpp
+++ b/ace/Module.cpp
@@ -179,9 +179,6 @@ ACE_Module<ACE_SYNCH_2>::close (int flags /* = M_DELETE_NONE */)
{
ACE_TRACE ("ACE_Module<ACE_SYNCH_2>::close");
- ACE_Task<ACE_SYNCH_2> *reader_q = this->reader ();
- ACE_Task<ACE_SYNCH_2> *writer_q = this->writer ();
-
int result = 0;
ACE_SET_BITS (flags_, flags);
diff --git a/ace/OS.h b/ace/OS.h
index 7af6fa9fce4..5bc093c9b13 100644
--- a/ace/OS.h
+++ b/ace/OS.h
@@ -851,6 +851,7 @@ struct ACE_rwlock_t
#define THR_BOUND 0 // ?? ignore in most places
#define THR_NEW_LWP 0 // ?? ignore in most places
#define THR_SUSPENDED CREATE_SUSPENDED
+#endif /* ACE_HAS_DCETHREADS || ACE_HAS_PTHREADS */
#else /* !ACE_HAS_THREADS, i.e., the OS/platform doesn't support threading. */
// Give these things some reasonable value...
#define THR_CANCEL_DISABLE 0
@@ -874,7 +875,6 @@ typedef int ACE_rwlock_t;
typedef int ACE_thread_t;
typedef int ACE_hthread_t;
typedef int ACE_thread_key_t;
-#endif /* ACE_HAS_DCETHREADS || ACE_HAS_PTHREADS */
#endif /* ACE_HAS_THREADS */
#include /**/ <sys/types.h>
@@ -1062,6 +1062,7 @@ typedef void (*ACE_SignalHandlerV)(...);
#define ACE_LD_SEARCH_PATH_SEPARATOR_STR ";"
#define ACE_LOGGER_KEY __TEXT ("\\temp\\server_daemon")
#define ACE_DLL_SUFFIX ".dll"
+#define ACE_DLL_PREFIX ""
// This will help until we figure out everything:
#define NFDBITS 32 // only used in unused functions...
@@ -1289,6 +1290,7 @@ typedef char TCHAR;
#define ACE_LD_SEARCH_PATH_SEPARATOR_STR ":"
#define ACE_LOGGER_KEY "/tmp/server_daemon"
#define ACE_DLL_SUFFIX ".so"
+#define ACE_DLL_PREFIX "lib"
// Wrapper for NT events on UNIX.
struct ACE_event_t
@@ -2182,6 +2184,8 @@ public:
*optval, int *optlen);
static long inet_addr (const char *name);
static char *inet_ntoa (const struct in_addr addr);
+ static int inet_aton (const char *strptr, struct in_addr *addr);
+
static int listen (ACE_HANDLE handle, int backlog);
static int recv (ACE_HANDLE handle, char *buf, int len, int flags = 0);
static int recvfrom (ACE_HANDLE handle, char *buf, int len, int flags,
diff --git a/ace/OS.i b/ace/OS.i
index d07b1c365e3..bdc2d972bb3 100644
--- a/ace/OS.i
+++ b/ace/OS.i
@@ -2554,7 +2554,6 @@ ACE_OS::inet_addr (const char *name)
{
// ACE_TRACE ("ACE_OS::inet_addr");
#if defined (VXWORKS)
-
u_long retval = 0;
u_int segment;
@@ -2573,9 +2572,7 @@ ACE_OS::inet_addr (const char *name)
retval |= segment;
if (*name == '.')
- {
- ++name;
- }
+ ++name;
}
}
return (long) htonl (retval);
@@ -2588,6 +2585,19 @@ ACE_OS::inet_addr (const char *name)
#endif /* ACE_HAS_NONCONST_GETBY */
}
+ACE_INLINE int
+ACE_OS::inet_aton (const char *host_name, struct in_addr *addr)
+{
+ long ip_addr = ACE_OS::inet_addr (host_name);
+ if (ip_addr == htonl (-1)
+ // Broadcast addresses are weird...
+ && ACE_OS::strcmp (host_name, "255.255.255.255") != 0)
+ return 0;
+ else if (addr != 0)
+ ACE_OS::memcpy ((void *) addr, (void *) &ip_addr, sizeof ip_addr);
+ return 1;
+}
+
ACE_INLINE char *
ACE_OS::inet_ntoa (const struct in_addr addr)
{
diff --git a/ace/Reactor.cpp b/ace/Reactor.cpp
index 7733cb2b29a..90c31d832e0 100644
--- a/ace/Reactor.cpp
+++ b/ace/Reactor.cpp
@@ -1279,6 +1279,9 @@ ACE_Reactor::detach (ACE_HANDLE handle,
this->ex_handle_mask_,
ACE_Reactor::CLR_MASK);
+ // Reinitialize the Reactor pointer to 0.
+ // eh->reactor (0);
+
if (ACE_BIT_ENABLED (mask, ACE_Event_Handler::DONT_CALL) == 0)
eh->handle_close (handle, mask);
@@ -1287,8 +1290,6 @@ ACE_Reactor::detach (ACE_HANDLE handle,
this->rd_handle_mask_,
this->wr_handle_mask_,
this->ex_handle_mask_);
- // Reinitialize the Reactor pointer to 0.
- eh->reactor (0);
return 0;
}
diff --git a/ace/ReactorEx.cpp b/ace/ReactorEx.cpp
index 0f67963cfc1..b4ef780446f 100644
--- a/ace/ReactorEx.cpp
+++ b/ace/ReactorEx.cpp
@@ -64,7 +64,7 @@ ACE_ReactorEx::register_handler (ACE_Event_Handler *eh,
int
ACE_ReactorEx::remove_handler (ACE_Event_Handler *eh,
- ACE_Reactor_Mask mask)
+ ACE_Reactor_Mask mask)
{
ACE_GUARD_RETURN (ACE_ReactorEx_Token, ace_mon, this->token_, -1);
@@ -79,7 +79,7 @@ ACE_ReactorEx::remove_handler (ACE_Event_Handler *eh,
{
if (ACE_BIT_ENABLED (mask, ACE_Event_Handler::DONT_CALL) == 0)
event_handlers_[index]->handle_close (handle,
- ACE_Event_Handler::NULL_MASK);
+ ACE_Event_Handler::NULL_MASK);
// If there was only one handle, reset the pointer to 0.
if (this->active_handles_ == 1)
diff --git a/ace/Service_Config.cpp b/ace/Service_Config.cpp
index 2e7852acef7..cbff406a9cd 100644
--- a/ace/Service_Config.cpp
+++ b/ace/Service_Config.cpp
@@ -665,8 +665,8 @@ ACE_Service_Config::run_reactor_event_loop (ACE_Time_Value &tv)
int result = ACE_Service_Config::reactor ()->handle_events (tv);
if (ACE_Service_Config::reconfig_occurred_)
ACE_Service_Config::reconfigure ();
- else if (result == -1)
- return -1;
+ else if (result <= 0)
+ return result;
}
/* NOTREACHED */
@@ -799,8 +799,8 @@ ACE_Service_Config::run_proactor_event_loop (ACE_Time_Value &tv)
int result = ACE_Service_Config::proactor ()->handle_events (tv);
if (ACE_Service_Config::reconfig_occurred_)
ACE_Service_Config::reconfigure ();
- else if (result == -1)
- return -1;
+ else if (result <= 0)
+ return result;
}
/* NOTREACHED */
@@ -857,8 +857,8 @@ ACE_Service_Config::run_reactorEx_event_loop (ACE_Time_Value &tv)
int result = ACE_Service_Config::reactorEx ()->handle_events (tv);
if (ACE_Service_Config::reconfig_occurred_)
ACE_Service_Config::reconfigure ();
- else if (result == -1)
- return -1;
+ else if (result <= 0)
+ return result;
}
/* NOTREACHED */
diff --git a/ace/Service_Config.h b/ace/Service_Config.h
index a6104b72265..ae7819f18bc 100644
--- a/ace/Service_Config.h
+++ b/ace/Service_Config.h
@@ -30,6 +30,11 @@ class ACE_Reactor;
class ACE_Proactor;
class ACE_ReactorEx;
+extern "C"
+{
+typedef ACE_Service_Object *(*ACE_SERVICE_ALLOCATOR)(void);
+}
+
struct ACE_Static_Svc_Descriptor
{
char *name_;
@@ -38,7 +43,7 @@ struct ACE_Static_Svc_Descriptor
int type_;
// Type of service.
- ACE_Service_Object *(*alloc_)(void);
+ ACE_SERVICE_ALLOCATOR alloc_;
// Factory function that allocates the service.
u_int flags_;
diff --git a/ace/Thread.h b/ace/Thread.h
index 02f8f1d8e46..aab4b61f413 100644
--- a/ace/Thread.h
+++ b/ace/Thread.h
@@ -98,8 +98,11 @@ public:
static void yield (void);
// Yield the thread to another.
- static void self (ACE_hthread_t &t_id);
- // Return the unique kernel ID of the thread.
+ static void self (ACE_hthread_t &t_handle);
+ // Return the unique kernel handle of the thread. Note that on
+ // Win32 this is actually a pseudohandle, which cannot be shared
+ // with other processes or waited on by threads. To locate the real
+ // handle, please use the <ACE_Thread_Manager::thr_self> method.
static ACE_thread_t self (void);
// Return the unique ID of the thread.