summaryrefslogtreecommitdiff
path: root/ace
diff options
context:
space:
mode:
Diffstat (limited to 'ace')
-rw-r--r--ace/ACE.cpp173
-rw-r--r--ace/ACE.h82
-rw-r--r--ace/INET_Addr.cpp2
-rw-r--r--ace/Log_Msg.h2
-rw-r--r--ace/Message_Queue.h29
-rw-r--r--ace/OS.h22
-rw-r--r--ace/OS.i23
-rw-r--r--ace/Pipe.cpp7
-rw-r--r--ace/README1
-rw-r--r--ace/SOCK.h11
-rw-r--r--ace/SOCK_Dgram.h1
-rw-r--r--ace/SPIPE_Acceptor.cpp1
-rw-r--r--ace/SV_Semaphore_Complex.h5
-rw-r--r--ace/Service_Main.cpp8
-rw-r--r--ace/Stream.cpp9
-rw-r--r--ace/Synch.h2
-rw-r--r--ace/Synch.i9
-rw-r--r--ace/Synch_T.h13
-rw-r--r--ace/TLI_Acceptor.cpp3
-rw-r--r--ace/Task.cpp6
-rw-r--r--ace/Thread_Manager.cpp10
-rw-r--r--ace/XtReactor.cpp3
-rw-r--r--ace/XtReactor.h1
-rw-r--r--ace/config-vxworks-ghs-1.8.h4
-rw-r--r--ace/config-vxworks5.2-g++.h4
-rw-r--r--ace/config-win32-msvc2.0.h88
-rw-r--r--ace/config-win32-msvc4.0.h86
27 files changed, 407 insertions, 198 deletions
diff --git a/ace/ACE.cpp b/ace/ACE.cpp
index f3f88f79ef2..5445829bc32 100644
--- a/ace/ACE.cpp
+++ b/ace/ACE.cpp
@@ -226,27 +226,76 @@ ACE::send_n (ACE_HANDLE handle, const void *buf, size_t len)
{
ACE_TRACE ("ACE::send_n");
size_t bytes_written;
- int n;
+ ssize_t n;
for (bytes_written = 0; bytes_written < len; bytes_written += n)
- if ((n = ACE::send (handle, (const char *) buf + bytes_written,
- len - bytes_written)) == -1)
- return -1;
+ {
+ n = ACE::send (handle, (const char *) buf + bytes_written,
+ len - bytes_written);
+ if (n == -1)
+ {
+ if (errno != EWOULDBLOCK)
+ return -1;
+ else
+ n = 0; // Keep trying to send.
+ }
+ }
return bytes_written;
}
ssize_t
-ACE::send_n (ACE_HANDLE handle, const void *buf, size_t len, int flags)
+ACE::send_n (ACE_HANDLE handle,
+ const void *buf,
+ size_t len,
+ int flags)
{
ACE_TRACE ("ACE::send_n");
size_t bytes_written;
- int n;
+ ssize_t n;
for (bytes_written = 0; bytes_written < len; bytes_written += n)
- if ((n = ACE_OS::send (handle, (const char *) buf + bytes_written,
- len - bytes_written, flags)) == -1)
- return -1;
+ {
+ n = ACE_OS::send (handle, (const char *) buf + bytes_written,
+ len - bytes_written, flags);
+
+ if (n == -1)
+ {
+ if (errno != EWOULDBLOCK)
+ return -1;
+ else
+ n = 0; // Keep trying to send.
+ }
+ }
+
+ return bytes_written;
+}
+
+// Receive <len> bytes into <buf> from <handle> (uses the <write>
+// system call on UNIX and the <WriteFile> call on Win32).
+
+ssize_t
+ACE::write_n (ACE_HANDLE handle,
+ const void *buf,
+ size_t len)
+{
+ ACE_TRACE ("ACE::write_n");
+
+ size_t bytes_written;
+ ssize_t n;
+
+ for (bytes_written = 0; bytes_written < len; bytes_written += n)
+ {
+ n = ACE_OS::write (handle, (const char *) buf + bytes_written,
+ len - bytes_written);
+ if (n == -1)
+ {
+ if (errno != EWOULDBLOCK)
+ return -1;
+ else
+ n = 0; // Keep trying to send.
+ }
+ }
return bytes_written;
}
@@ -256,15 +305,22 @@ ACE::recv_n (ACE_HANDLE handle, void *buf, size_t len)
{
ACE_TRACE ("ACE::recv_n");
size_t bytes_read;
- int n;
+ ssize_t n;
for (bytes_read = 0; bytes_read < len; bytes_read += n)
- if ((n = ACE::recv (handle, (char *) buf + bytes_read,
- len - bytes_read)) == -1)
- return -1;
- else if (n == 0)
- break;
+ {
+ n = ACE::recv (handle, (char *) buf + bytes_read, len - bytes_read);
+ if (n == -1)
+ {
+ if (errno != EWOULDBLOCK)
+ return -1;
+ else
+ n = 0; // Keep trying to read.
+ }
+ else if (n == 0)
+ break;
+ }
return bytes_read;
}
@@ -273,20 +329,29 @@ ACE::recv_n (ACE_HANDLE handle, void *buf, size_t len, int flags)
{
ACE_TRACE ("ACE::recv_n");
size_t bytes_read;
- int n;
+ ssize_t n;
for (bytes_read = 0; bytes_read < len; bytes_read += n)
- if ((n = ACE_OS::recv (handle, (char *) buf + bytes_read,
- len - bytes_read, flags)) == -1)
- return -1;
- else if (n == 0)
- break;
+ {
+ n = ACE::recv (handle, (char *) buf + bytes_read, len - bytes_read, flags);
+
+ if (n == -1)
+ {
+ if (errno != EWOULDBLOCK)
+ return -1;
+ else
+ n = 0; // Keep trying to read.
+ }
+ else if (n == 0)
+ break;
+ }
return bytes_read;
}
- // Receive <len> bytes into <buf> from <handle> (uses the <read>
- // system call on UNIX and the <ReadFile> call on Win32).
+// Receive <len> bytes into <buf> from <handle> (uses the <read>
+// system call on UNIX and the <ReadFile> call on Win32).
+
ssize_t
ACE::read_n (ACE_HANDLE handle,
void *buf,
@@ -295,37 +360,24 @@ ACE::read_n (ACE_HANDLE handle,
ACE_TRACE ("ACE::read_n");
size_t bytes_read;
- int n;
+ ssize_t n;
for (bytes_read = 0; bytes_read < len; bytes_read += n)
- if ((n = ACE_OS::read (handle, (char *) buf + bytes_read,
- len - bytes_read)) == -1)
- return -1;
- else if (n == 0)
- break;
-
- return bytes_read;
-}
-
-// Receive <len> bytes into <buf> from <handle> (uses the <write>
-// system call on UNIX and the <WriteFile> call on Win32).
-
-ssize_t
-ACE::write_n (ACE_HANDLE handle,
- const void *buf,
- size_t len)
-{
- ACE_TRACE ("ACE::write_n");
-
- size_t bytes_written;
- int n;
+ {
+ n = ACE_OS::read (handle, (char *) buf + bytes_read, len - bytes_read);
- for (bytes_written = 0; bytes_written < len; bytes_written += n)
- if ((n = ACE_OS::write (handle, (const char *) buf + bytes_written,
- len - bytes_written)) == -1)
- return -1;
+ if (n == -1)
+ {
+ if (errno != EWOULDBLOCK)
+ return -1;
+ else
+ n = 0; // Keep trying to read.
+ }
+ else if (n == 0)
+ break;
+ }
- return bytes_written;
+ return bytes_read;
}
// Format buffer into printable format. This is useful for debugging.
@@ -460,13 +512,26 @@ ACE::handle_timed_complete (ACE_HANDLE h,
ACE_Handle_Set rd_handles;
ACE_Handle_Set wr_handles;
+#if defined (ACE_WIN32)
+ ACE_Handle_Set ex_handles;
+ ex_handles.set_bit (h);
+#endif /* ACE_WIN32 */
rd_handles.set_bit (h);
wr_handles.set_bit (h);
+#if defined (ACE_WIN32)
+ int n = ACE_OS::select (int (h) + 1,
+ rd_handles,
+ wr_handles,
+ ex_handles,
+ timeout);
+#else
int n = ACE_OS::select (int (h) + 1,
rd_handles,
wr_handles,
0, timeout);
+#endif /* ACE_WIN32 */
+
// If we failed to connect within the time period allocated by the
// caller, then we fail (e.g., the remote host might have been too
// busy to accept our call).
@@ -479,11 +544,13 @@ ACE::handle_timed_complete (ACE_HANDLE h,
// Check if the handle is ready for reading and the handle is *not*
// ready for writing, which may indicate a problem. But we need to
// make sure...
-#if defined (ACE_HAS_TLI)
+#if defined (ACE_WIN32)
+ else if (rd_handles.is_set (h) || ex_handles.is_set (h))
+#elif defined (ACE_HAS_TLI)
else if (rd_handles.is_set (h) && !wr_handles.is_set (h))
#else
else if (rd_handles.is_set (h))
-#endif /* ACE_HAS_TLI */
+#endif /* ACE_WIN32 */
{
char dummy;
// The following recv() won't block provided that the
@@ -597,7 +664,7 @@ ACE::bind_port (ACE_HANDLE handle)
ACE_OS::memset ((void *) &sin, 0, sizeof sin);
sin.sin_family = AF_INET;
#if defined (ACE_HAS_SIN_LEN)
- sin.sin_family = sizeof sin;
+ sin.sin_len = sizeof sin;
#endif /* ACE_HAS_SIN_LEN */
sin.sin_addr.s_addr = INADDR_ANY;
diff --git a/ace/ACE.h b/ace/ACE.h
index 07410b481df..e9441a3b44b 100644
--- a/ace/ACE.h
+++ b/ace/ACE.h
@@ -61,6 +61,23 @@ public:
// out a -1 is returned with <errno == ETIME>. If it succeeds the
// number of bytes received is returned.
+ // = Network I/O functions that recv and send exactly n bytes.
+ static ssize_t recv_n (ACE_HANDLE handle,
+ void *buf,
+ size_t len,
+ int flags);
+ // Receive <len> bytes into <buf> from <handle> (uses the <recv>
+ // call). If <handle> is set to non-blocking mode this call will
+ // poll until all <len> bytes are received.
+
+ static ssize_t recv_n (ACE_HANDLE handle,
+ void *buf,
+ size_t len);
+ // Receive <len> bytes into <buf> from <handle> (uses the <read>
+ // system call on UNIX and the <recv> call on Win32). If <handle>
+ // is set to non-blocking mode this call will poll until all <len>
+ // bytes are received.
+
static ssize_t recv_n (ACE_HANDLE handle,
void *buf,
size_t len,
@@ -81,13 +98,35 @@ public:
static ssize_t send (ACE_HANDLE handle,
const void *buf,
+ size_t len);
+ // Send up to <len> bytes into <buf> from <handle> (uses the <write>
+ // system call on UNIX and the <send> call on Win32).
+
+ static ssize_t send_n (ACE_HANDLE handle,
+ const void *buf,
+ size_t len,
+ int flags);
+ // Send <len> bytes from <buf> to <handle> (uses the <send> system
+ // call). If <handle> is set to non-blocking mode this call will
+ // poll until all <len> bytes are sent.
+
+ static ssize_t send_n (ACE_HANDLE handle,
+ const void *buf,
+ size_t len);
+ // Send <len> bytes from <buf> to <handle> (uses the <write> system
+ // call on UNIX and the <recv> call on Win32). If <handle> is set
+ // to non-blocking mode this call will poll until all <len> bytes
+ // are sent.
+
+ static ssize_t send (ACE_HANDLE handle,
+ const void *buf,
size_t len,
int flags,
const ACE_Time_Value *timeout);
// Wait to to <timeout> amount of time to send up to <len> bytes
// into <buf> from <handle> (uses the <send> call). If <send> times
// out a -1 is returned with <errno == ETIME>. If it succeeds the
- // number of bytes sent is returned.
+ // number of bytes sent is returned.
static ssize_t send_n (ACE_HANDLE handle,
const void *buf,
@@ -100,51 +139,22 @@ public:
// If a timeout does not occur, <send_n> return <len> (i.e., the
// number of bytes requested to be sent).
- static ssize_t send (ACE_HANDLE handle,
- const void *buf,
- size_t len);
- // Send up to <len> bytes into <buf> from <handle> (uses the <write>
- // system call on UNIX and the <send> call on Win32).
-
- // = Network I/O functions that recv and send exactly n bytes.
- static ssize_t recv_n (ACE_HANDLE handle,
- void *buf,
- size_t len,
- int flags);
- // Receive <len> bytes into <buf> from <handle> (uses the <recv>
- // call).
-
- static ssize_t recv_n (ACE_HANDLE handle,
- void *buf,
- size_t len);
- // Receive <len> bytes into <buf> from <handle> (uses the <read>
- // system call on UNIX and the <recv> call on Win32).
-
- static ssize_t send_n (ACE_HANDLE handle,
- const void *buf,
- size_t len,
- int flags);
- // Send <len> bytes from <buf> to <handle> (uses the <send> system
- // call).
-
- static ssize_t send_n (ACE_HANDLE handle,
- const void *buf,
- size_t len);
- // Send <len> bytes from <buf> to <handle> (uses the <write> system
- // call on UNIX and the <recv> call on Win32).
-
// = File system I/O functions that encapsulate differences between UNIX and Win32 and also send and recv exactly n bytes.
static ssize_t read_n (ACE_HANDLE handle,
void *buf,
size_t len);
// Receive <len> bytes into <buf> from <handle> (uses the <read>
- // system call on UNIX and the <ReadFile> call on Win32).
+ // system call on UNIX and the <ReadFile> call on Win32). If
+ // <handle> is set to non-blocking mode this call will poll until
+ // all <len> bytes are received.
static ssize_t write_n (ACE_HANDLE handle,
const void *buf,
size_t len);
// Send <len> bytes from <buf> to <handle> (uses the <write> system
- // call on UNIX and the <WriteFile> call on Win32).
+ // call on UNIX and the <WriteFile> call on Win32). If <handle> is
+ // set to non-blocking mode this call will poll until all <len>
+ // bytes are sent.
// = Functions that perform useful behavior related to establishing
// socket connections active and passively.
diff --git a/ace/INET_Addr.cpp b/ace/INET_Addr.cpp
index 5a98da7ce94..18d17b1dd38 100644
--- a/ace/INET_Addr.cpp
+++ b/ace/INET_Addr.cpp
@@ -1,7 +1,7 @@
// INET_Addr.cpp
// $Id$
-/* Defines the Internet domain address family address format. */
+// Defines the Internet domain address family address format.
#define ACE_BUILD_DLL
#include "ace/INET_Addr.h"
diff --git a/ace/Log_Msg.h b/ace/Log_Msg.h
index 5af0a8f5349..71d1d98e204 100644
--- a/ace/Log_Msg.h
+++ b/ace/Log_Msg.h
@@ -34,7 +34,7 @@
#if defined (ACE_NLOGGING)
#define ACE_HEX_DUMP(X)
-#define ACE_RETURN(ERROR, Y) do { errno = ERROR, return (Y); } while (0)
+#define ACE_RETURN(Y) do { return (Y); } while (0)
#define ACE_ERROR_RETURN(X, Y) return (Y)
#define ACE_ERROR_BREAK(X) { break; }
#define ACE_ERROR(X)
diff --git a/ace/Message_Queue.h b/ace/Message_Queue.h
index b91a56fda1a..73fa40f3108 100644
--- a/ace/Message_Queue.h
+++ b/ace/Message_Queue.h
@@ -1,7 +1,6 @@
/* -*- C++ -*- */
// $Id$
-
// ============================================================================
//
// = LIBRARY
@@ -33,11 +32,11 @@ class ACE_Message_Queue_Reverse_Iterator;
template <ACE_SYNCH_1>
class ACE_Message_Queue
// = TITLE
- // A thread-safe message queueing facility, modeled after the
- // queueing facilities in System V StreamS.
+ // A threaded message queueing facility, modeled after the
+ // queueing facilities in System V STREAMs.
//
// = DESCRIPTION
- // A ACE_Message_Queue is the central queueing facility for
+ // An <ACE_Message_Queue> is the central queueing facility for
// messages in the ASX framework. If <ACE_SYNCH_1> is
// ACE_MT_SYNCH then all operations are thread-safe. Otherwise,
// if it's <ACE_NULL_SYNCH> then there's no locking overhead.
@@ -46,9 +45,9 @@ friend class ACE_Message_Queue_Iterator<ACE_SYNCH_2>;
friend class ACE_Message_Queue_Reverse_Iterator<ACE_SYNCH_2>;
public:
+ // = Traits
typedef ACE_Message_Queue_Iterator<ACE_SYNCH_2> ITERATOR;
typedef ACE_Message_Queue_Reverse_Iterator<ACE_SYNCH_2> REVERSE_ITERATOR;
- // Traits
// = Default high and low water marks.
enum
@@ -82,11 +81,7 @@ public:
// Returns -1 on failure, else the number of items still on the
// queue.
- // = For all the following three routines if tv == 0, the caller
- // will block until action is possible, else will wait for amount of
- // time in *tv). Calls will return, however, when queue is closed,
- // deactivated, when a signal occurs, or if the time specified in tv
- // elapses, (in which case errno = EWOULDBLOCK).
+ // = For all the following three routines if tv == 0, the caller will block until action is possible, else will wait until the absolute time specified in *tv elapses). Calls will return, however, when queue is closed, deactivated, when a signal occurs, or if the time specified in tv elapses, (in which case errno = EWOULDBLOCK).
int enqueue (ACE_Message_Block *new_item, ACE_Time_Value *tv = 0);
// Enqueue an <ACE_Message_Block *> into the <Message_Queue> in
@@ -156,8 +151,7 @@ public:
// Declare the dynamic allocation hooks.
protected:
- // = Routines that actually do the enqueueing and dequeueing (these
- // assume that locks are held by the corresponding public methods).
+ // = Routines that actually do the enqueueing and dequeueing (these assume that locks are held by the corresponding public methods).
int enqueue_i (ACE_Message_Block *new_item);
// Enqueue an <ACE_Message_Block *> in accordance with its priority.
@@ -178,8 +172,7 @@ protected:
int is_empty_i (void);
// True if queue is empty, else false.
- // = Implementation of the public activate() and deactivate()
- // methods above (assumes locks are held).
+ // = Implementation of the public activate() and deactivate() methods above (assumes locks are held).
int deactivate_i (void);
// Deactivate the queue.
int activate_i (void);
@@ -220,9 +213,7 @@ protected:
template <ACE_SYNCH_1>
class ACE_Message_Queue_Iterator
// = TITLE
- // Iterator for the ACE_Message_Queue.
- //
- // = DESCRIPTION
+ // Iterator for the <ACE_Message_Queue>.
{
public:
// = Initialization method.
@@ -253,9 +244,7 @@ private:
template <ACE_SYNCH_1>
class ACE_Message_Queue_Reverse_Iterator
// = TITLE
- // Reverse Iterator for the ACE_Message_Queue.
- //
- // = DESCRIPTION
+ // Reverse Iterator for the <ACE_Message_Queue>.
{
public:
// = Initialization method.
diff --git a/ace/OS.h b/ace/OS.h
index 463e23162d5..cc80d06c7de 100644
--- a/ace/OS.h
+++ b/ace/OS.h
@@ -106,6 +106,12 @@
// Here are all ACE-specific global declarations needed throughout
// ACE.
+#if defined (ACE_HAS_USING_KEYWORD)
+#define ACE_USING using
+#else
+#define ACE_USING
+#endif /* ACE_HAS_USING_KEYWORD */
+
// Helpful dump macros.
#define ACE_BEGIN_DUMP "\n====\n(%P|%t|%x)"
#define ACE_END_DUMP "====\n"
@@ -952,7 +958,9 @@ typedef void (*ACE_SignalHandlerV)(...);
// mistakenly passing an HPEN to a routine expecting an HBITMAP.
// Note that we only use this if we
#if defined (ACE_HAS_STRICT)
+#if !defined (STRICT) // may already be defined
#define STRICT
+#endif /* !STRICT */
#endif /* ACE_HAS_STRICT */
#include /**/ <sys/timeb.h>
@@ -983,11 +991,6 @@ typedef void (*ACE_SignalHandlerV)(...);
#define ACE_INVALID_SEM_KEY 0
#define ACE_DEFAULT_MUTEX __TEXT ("ACE_MUTEX")
-// This flag speeds up the inclusion of Win32 header files.
-#if !defined (WIN32_LEAN_AND_MEAN)
-#define WIN32_LEAN_AND_MEAN 1
-#endif /* !defined (WIN32_LEAN_AND_MEAN) */
-
#define ACE_SEH_TRY __try
#define ACE_SEH_EXCEPT(X) __except(X)
@@ -1041,17 +1044,8 @@ PAGE_GUARD
PAGE_NOACCESS
PAGE_NOCACHE */
-// This is necessary since MFC users apparently can't #include
-// <windows.h> directly.
-#if !defined (__AFX_H__)
-#include /**/ <windows.h>
-#endif /* __AFX_H__ */
-
#if defined (ACE_HAS_WINSOCK2)
-#include /**/ <winsock2.h>
#include "ace/ws2tcpip.h"
-#else
-#include /**/ <winsock.h>
#endif /* ACE_HAS_WINSOCK2 */
#define MAXHOSTNAMELEN 256
diff --git a/ace/OS.i b/ace/OS.i
index 7fef6bcc600..5bbfeeed82d 100644
--- a/ace/OS.i
+++ b/ace/OS.i
@@ -284,12 +284,25 @@ ACE_OS::pipe (ACE_HANDLE fds[])
#endif /* VXWORKS */
}
+#if defined (DIGITAL_UNIX)
+extern "C" {
+ extern char *_Pctime_r (const time_t *, char *);
+ extern struct tm *_Plocaltime_r (const time_t *, struct tm *);
+ extern char *_Pasctime_r (const struct tm *, char *);
+ extern int _Prand_r (unsigned int *seedptr);
+}
+#endif /* DIGITAL_UNIX */
+
ACE_INLINE int
ACE_OS::rand_r (ACE_RANDR_TYPE seed)
{
// ACE_TRACE ("ACE_OS::rand_r");
#if defined (ACE_HAS_REENTRANT_FUNCTIONS) && defined (ACE_MT_SAFE)
+#if defined (DIGITAL_UNIX)
+ ACE_OSCALL_RETURN (::_Prand_r (seed), int, -1);
+#else
ACE_OSCALL_RETURN (::rand_r (seed), int, -1);
+#endif /* DIGITAL_UNIX */
#else
seed = seed;
ACE_OSCALL_RETURN (::rand (), int, -1);
@@ -4579,14 +4592,6 @@ ACE_OS::ctime (const time_t *t)
#endif // ACE_HAS_BROKEN_CTIME)
}
-#if defined (DIGITAL_UNIX)
-extern "C" {
- extern char *_Pctime_r (const time_t *, char *);
- extern struct tm *_Plocaltime_r (const time_t *, struct tm *);
- extern char *_Pasctime_r (const struct tm *, char *);
-}
-#endif /* DIGITAL_UNIX */
-
ACE_INLINE char *
ACE_OS::ctime_r (const time_t *t, char *buf, int buflen)
{
@@ -5238,7 +5243,7 @@ ACE_OS::mkdir (const char *path, mode_t mode)
#if defined (ACE_WIN32)
ACE_OSCALL_RETURN (::_mkdir (path), int, -1);
#elif defined (VXWORKS)
- ACE_OSCALL_RETURN (::_mkdir ((char *) path), int, -1);
+ 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 8101c915453..17654051b00 100644
--- a/ace/Pipe.cpp
+++ b/ace/Pipe.cpp
@@ -30,10 +30,9 @@ ACE_Pipe::open (void)
ACE_SOCK_Stream writer;
int result = 0;
- // Bind listener to any port
- if (acceptor.open (ACE_Addr::sap_any) == -1)
- result = -1;
- else if (acceptor.get_local_addr (my_addr) == -1)
+ // Bind listener to any port and then find out what the port was.
+ if (acceptor.open (ACE_Addr::sap_any) == -1
+ || acceptor.get_local_addr (my_addr) == -1)
result = -1;
else
{
diff --git a/ace/README b/ace/README
index fbcca13ce6f..08f645766a0 100644
--- a/ace/README
+++ b/ace/README
@@ -120,6 +120,7 @@ ACE_HAS_UCONTEXT_T Platform supports ucontext_t (which is used in the extended
ACE_HAS_UNION_WAIT The wait() system call takes a (union wait *) rather than int *
ACE_HAS_UNIXWARE_SVR4_SIGNAL_T Has inconsistent SVR4 signal stuff, but not the same as the other platforms
ACE_HAS_UNICODE Platform/compiler supports UNICODE
+ACE_HAS_USING_KEYWORD Compiler supports the new using keyword for C++ namespaces.
ACE_HAS_VOIDPTR_MMAP Platform requires void * for mmap().
ACE_HAS_VOIDPTR_SOCKOPT OS/compiler uses void * arg 4 setsockopt() rather than const char *
ACE_HAS_WIN32_TRYLOCK The Win32 platform support TryEnterCriticalSection()
diff --git a/ace/SOCK.h b/ace/SOCK.h
index fd0ef7789df..bc2e64dc022 100644
--- a/ace/SOCK.h
+++ b/ace/SOCK.h
@@ -1,7 +1,6 @@
/* -*- C++ -*- */
// $Id$
-
// ============================================================================
//
// = LIBRARY
@@ -28,11 +27,6 @@ class ACE_Export ACE_SOCK : public ACE_IPC_SAP
// ACE_SOCK abstraction.
{
public:
- int open (int type,
- int protocol_family,
- int protocol);
- // Wrapper around the socket() system call.
-
int set_option (int level,
int option,
void *optval,
@@ -66,6 +60,11 @@ protected:
ACE_SOCK (void);
// Default constructor.
+ int open (int type,
+ int protocol_family,
+ int protocol);
+ // Wrapper around the socket() system call.
+
ACE_SOCK (int type, int protocol_family, int protocol = 0);
// Wrapper around the socket() system call.
diff --git a/ace/SOCK_Dgram.h b/ace/SOCK_Dgram.h
index 8ce511532bd..402a38c9bce 100644
--- a/ace/SOCK_Dgram.h
+++ b/ace/SOCK_Dgram.h
@@ -1,7 +1,6 @@
/* -*- C++ -*- */
// $Id$
-
// ===========================================================================
//
// = LIBRARY
diff --git a/ace/SPIPE_Acceptor.cpp b/ace/SPIPE_Acceptor.cpp
index 6c2d64742b0..2597aa64b4d 100644
--- a/ace/SPIPE_Acceptor.cpp
+++ b/ace/SPIPE_Acceptor.cpp
@@ -113,7 +113,6 @@ ACE_SPIPE_Acceptor::close (void)
return result;
}
-ACE_INLINE
ACE_SPIPE_Acceptor::ACE_SPIPE_Acceptor (const ACE_SPIPE_Addr &local_sap,
int reuse_addr,
int perms)
diff --git a/ace/SV_Semaphore_Complex.h b/ace/SV_Semaphore_Complex.h
index 6d61ab30d1b..a0a198f385c 100644
--- a/ace/SV_Semaphore_Complex.h
+++ b/ace/SV_Semaphore_Complex.h
@@ -1,7 +1,6 @@
/* -*- C++ -*- */
// $Id$
-
// ============================================================================
//
// = LIBRARY
@@ -127,8 +126,8 @@ public:
int control (int cmd, int value = 0, int n = 0) const;
// = Upgrade access control...
- ACE_SV_Semaphore_Simple::get_id;
- ACE_SV_Semaphore_Simple::remove;
+ ACE_USING ACE_SV_Semaphore_Simple::get_id;
+ ACE_USING ACE_SV_Semaphore_Simple::remove;
void dump (void) const;
// Dump the state of an object.
diff --git a/ace/Service_Main.cpp b/ace/Service_Main.cpp
index f6d4ea1a4df..b96c06fe7db 100644
--- a/ace/Service_Main.cpp
+++ b/ace/Service_Main.cpp
@@ -18,16 +18,16 @@ sc_main (int argc, char *argv[])
ACE_ERROR ((LM_ERROR, "%p\n%a", "open", 1));
// Create an adapter to end the event loop.
- ACE_Sig_Adapter sa (ACE_Sig_Handler_Ex (ACE_Service_Config::end_reactor_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);
+ 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 (server_test.reactor_event_loop_done () == 0)
- server_test.run_reactor_event_loop ();
+ while (daemon.reactor_event_loop_done () == 0)
+ daemon.run_reactor_event_loop ();
return 0;
}
diff --git a/ace/Stream.cpp b/ace/Stream.cpp
index 7b120ef43f3..5780ecbc6c4 100644
--- a/ace/Stream.cpp
+++ b/ace/Stream.cpp
@@ -236,8 +236,9 @@ ACE_Stream<ACE_SYNCH_2>::open (void *a,
{
ACE_TRACE ("ACE_Stream<ACE_SYNCH_2>::open");
ACE_GUARD_RETURN (ACE_SYNCH_MUTEX, ace_mon, this->lock_, -1);
- ACE_Task<ACE_SYNCH_2> *h1, *h2;
- ACE_Task<ACE_SYNCH_2> *t1, *t2;
+
+ ACE_Task<ACE_SYNCH_2> *h1 = 0, *h2 = 0;
+ ACE_Task<ACE_SYNCH_2> *t1 = 0, *t2 = 0;
if (head == 0)
{
@@ -255,8 +256,8 @@ ACE_Stream<ACE_SYNCH_2>::open (void *a,
}
// Make sure *all* the allocation succeeded!
- if (h1 == 0 || h2 == 0 || head == 0
- || t1 == 0 || t2 == 0 || tail == 0)
+ if (head == 0 && (h1 == 0 || h2 == 0)
+ || tail == 0 && (t1 == 0 || t2 == 0))
{
delete h1;
delete h2;
diff --git a/ace/Synch.h b/ace/Synch.h
index cd93af0fe77..030f7996c8b 100644
--- a/ace/Synch.h
+++ b/ace/Synch.h
@@ -22,7 +22,9 @@
#define ACE_SYNCH_H
#include "ace/ACE.h"
+#if !(defined (ACE_WIN32) || defined (ACE_HAS_POSIX_SEM))
#include "ace/SV_Semaphore_Complex.h"
+#endif /* !(defined (ACE_WIN32) || defined (ACE_HAS_POSIX_SEM)) */
// Forward declarations.
class ACE_Time_Value;
diff --git a/ace/Synch.i b/ace/Synch.i
index 461fbbe32b2..03f72d67af2 100644
--- a/ace/Synch.i
+++ b/ace/Synch.i
@@ -289,8 +289,13 @@ ACE_INLINE int
ACE_Thread_Mutex_Guard::release (void)
{
// ACE_TRACE ("ACE_Thread_Mutex_Guard::release");
- this->owner_ = -1;
- return this->lock_.release ();
+ if (this->owner_ != -1)
+ {
+ this->owner_ = -1;
+ return this->lock_.release ();
+ }
+ else
+ return 0;
}
// Explicitly release the lock.
diff --git a/ace/Synch_T.h b/ace/Synch_T.h
index 0f559bd2271..1353bcf7b88 100644
--- a/ace/Synch_T.h
+++ b/ace/Synch_T.h
@@ -259,8 +259,17 @@ public:
int tryacquire (void) { return this->owner_ = this->lock_->tryacquire (); }
// Conditionally acquire the lock (i.e., won't block).
- int release (void) { this->owner_ = -1; return this->lock_->release (); }
- // Explicitly release the lock.
+ int release (void)
+ {
+ if (this->owner_ != -1)
+ {
+ this->owner_ = -1;
+ return this->lock_->release ();
+ }
+ else
+ return 0;
+ }
+ // Explicitly release the lock, but only if it is held!
void dump (void) const;
// Dump the state of an object.
diff --git a/ace/TLI_Acceptor.cpp b/ace/TLI_Acceptor.cpp
index 4fce1af33d2..12415b3611a 100644
--- a/ace/TLI_Acceptor.cpp
+++ b/ace/TLI_Acceptor.cpp
@@ -142,7 +142,7 @@ open_new_endpoint (ACE_HANDLE listen_handle, const char dev[],
// Close down the acceptor and release resources.
-ACE_INLINE int
+int
ACE_TLI_Request_Queue::close (void)
{
ACE_TRACE ("ACE_TLI_Request_Queue::close");
@@ -189,7 +189,6 @@ ACE_TLI_Request_Queue::open (ACE_HANDLE f, int sz)
return 0;
}
-ACE_INLINE
ACE_TLI_Request_Queue::ACE_TLI_Request_Queue (void)
: size_ (0),
current_count_ (0),
diff --git a/ace/Task.cpp b/ace/Task.cpp
index dcdc13a74a0..b61699c8213 100644
--- a/ace/Task.cpp
+++ b/ace/Task.cpp
@@ -118,7 +118,7 @@ ACE_Task_Base::ACE_Task_Base (ACE_Thread_Manager *thr_man)
}
// Get the current group id.
-ACE_INLINE int
+int
ACE_Task_Base::grp_id (void)
{
ACE_TRACE ("ACE_Task_Base::grp_id");
@@ -127,7 +127,7 @@ ACE_Task_Base::grp_id (void)
}
// Set the current group id.
-ACE_INLINE void
+void
ACE_Task_Base::grp_id (int id)
{
ACE_TRACE ("ACE_Task_Base::grp_id");
@@ -184,7 +184,7 @@ ACE_Task_Base::activate (long flags,
this->thr_mgr_ = ACE_Service_Config::thr_mgr ();
this->grp_id_ = this->thr_mgr_->spawn_n (n_threads,
- &ACE_Task_Base::svc_run,
+ ACE_THR_FUNC (&ACE_Task_Base::svc_run),
(void *) this,
flags,
priority,
diff --git a/ace/Thread_Manager.cpp b/ace/Thread_Manager.cpp
index 388f83f1a9f..1573e94ed26 100644
--- a/ace/Thread_Manager.cpp
+++ b/ace/Thread_Manager.cpp
@@ -435,13 +435,17 @@ ACE_Thread_Manager::kill_thr (int i, int signum)
{
ACE_TRACE ("ACE_Thread_Manager::kill_thr");
- int result = ACE_Thread::kill ((ACE_thread_t) this->thr_table_[i].thr_handle_,
+ int result = ACE_Thread::kill ((ACE_thread_t) this->thr_table_[i].thr_id_,
signum);
- if (result != 0)
+ if (result != 0)
{
+ // We need to save this across calls to remove_thr() since that
+ // call may reset errno.
+ int error = errno;
+
this->remove_thr (i);
- errno = result;
+ errno = error;
return -1;
}
else
diff --git a/ace/XtReactor.cpp b/ace/XtReactor.cpp
index b3ce9a152f5..e51a3552181 100644
--- a/ace/XtReactor.cpp
+++ b/ace/XtReactor.cpp
@@ -26,7 +26,8 @@ ACE_XtReactor::ACE_XtReactor (XtAppContext context,
: ACE_Reactor (size, restart, h),
context_ (context),
id_len_ (0),
- ids_ (0)
+ ids_ (0),
+ timeout_ (0)
{
// When the ACE_Reactor is constructed it creates the notify pipe
// and registers it with the attach() method. The XtReactor
diff --git a/ace/XtReactor.h b/ace/XtReactor.h
index 7ba58b88867..a942757c48f 100644
--- a/ace/XtReactor.h
+++ b/ace/XtReactor.h
@@ -1,7 +1,6 @@
/* -*- C++ -*- */
// $Id$
-
// ============================================================================
//
// = LIBRARY
diff --git a/ace/config-vxworks-ghs-1.8.h b/ace/config-vxworks-ghs-1.8.h
index 9204d3f60d1..d8a5dcedbcd 100644
--- a/ace/config-vxworks-ghs-1.8.h
+++ b/ace/config-vxworks-ghs-1.8.h
@@ -50,5 +50,9 @@ typedef int key_t;
#include /**/ <stdarg.h>
#include /**/ <vxWorks.h>
+#if !defined (ACE_NTRACE)
+#define ACE_NTRACE 1
+#endif /* ACE_NTRACE */
+#define ACE_HAS_STRBUF_T
#endif /* ACE_CONFIG_H */
diff --git a/ace/config-vxworks5.2-g++.h b/ace/config-vxworks5.2-g++.h
index deaeac7d28e..94b6e353479 100644
--- a/ace/config-vxworks5.2-g++.h
+++ b/ace/config-vxworks5.2-g++.h
@@ -48,6 +48,10 @@
// Defines the page size of the system.
#define ACE_PAGE_SIZE 4096
+#if !defined (ACE_NTRACE)
+#define ACE_NTRACE 1
+#endif /* ACE_NTRACE */
+#define ACE_HAS_STRBUF_T
// vxWorks.h must be included before time.h, and key_t must be
// defined early also: these are here
diff --git a/ace/config-win32-msvc2.0.h b/ace/config-win32-msvc2.0.h
index 8bfd4740aa0..39e20521759 100644
--- a/ace/config-win32-msvc2.0.h
+++ b/ace/config-win32-msvc2.0.h
@@ -7,8 +7,91 @@
#if !defined (ACE_CONFIG_H)
#define ACE_CONFIG_H
+#if !defined (ACE_CONFIG_H)
+#define ACE_CONFIG_H
+
+#if defined (_MSC_VER)
+ // "C4355: 'this' : used in base member initializer list"
+ #pragma warning(disable:4355) // disable C4514 warning
+// #pragma warning(default:4355) // use this to reenable, if desired
+
+ #pragma warning(disable:4201) // winnt.h uses nameless structs
+#endif /* _MSC_VER */
+// While digging the MSVC 4.0 include files, I found how to disable MSVC
+// warnings:
+// --Amos Shapira
+
+// Comment this out for now since it will break existing application
+// code.
+#define ACE_HAS_STRICT
+
+// <windows.h> and MFC's <afxwin.h> are mutually
+// incompatible. <windows.h> is brain-dead about MFC; it doesn't check
+// to see whether MFC stuff is anticipated or already in progress
+// before doing its thing. ACE needs (practically always) <winsock.h>,
+// and winsock in turn needs support either from windows.h or from
+// afxwin.h. One or the other, not both.
+//
+// The MSVC++ V4.0 environment defines preprocessor macros that
+// indicate the programmer has chosen something from the
+// Build-->Settings-->General-->MFC combo-box. <afxwin.h> defines a
+// macro itself to protect against double inclusion. We'll take
+// advantage of all this to select the proper support for winsock. -
+// trl 26-July-1996
+
+// This is necessary since MFC users apparently can't #include
+// <windows.h> directly.
+#if ( defined (_AFXDLL) || defined (_WINDLL))
+ #include /**/ <afxwin.h> // He is doing MFC
+ // Windows.h will be included via afxwin.h->afx.h->afx_ver_.h->afxv_w32.h
+ // #define _INC_WINDOWS // Prevent winsock.h from including windows.h
+#endif
+
+#if !defined (_INC_WINDOWS) // Already include windows.h ?
+ // Must define strict before including windows.h !
+ #if (defined ACE_HAS_STRICT)
+ #define STRICT 1
+ #endif
+
+ #ifndef WIN32_LEAN_AND_MEAN
+ #define WIN32_LEAN_AND_MEAN
+ #endif
+
+ #ifdef _UNICODE
+ #ifndef UNICODE
+ #define UNICODE // UNICODE is used by Windows headers
+ #endif
+ #endif
+
+ #ifdef UNICODE
+ #ifndef _UNICODE
+ #define _UNICODE // _UNICODE is used by C-runtime/MFC headers
+ #endif
+ #endif
+#endif
+
+// Define the following macro if you're compiling with WinSock 2.0.
+// #define ACE_HAS_WINSOCK2
+
// Needed for timeval.
-#include /**/ <winsock.h>
+#if defined (ACE_HAS_WINSOCK2)
+ #ifndef _WINSOCK2API_
+ #include /**/ <winsock2.h> // will also include windows.h, if not present
+ #endif
+
+ #define ACE_WSOCK_VERSION 2, 0
+#else
+ #ifndef _WINSOCKAPI_
+ #include /**/ <winsock.h> // will also include windows.h, if not present
+ #endif
+
+ // Version 1.1 of WinSock
+ #define ACE_WSOCK_VERSION 1, 1
+#endif /* ACE_HAS_WINSOCK2 */
+
+#if defined (_MSC_VER)
+ #pragma warning(default: 4201) // winnt.h uses nameless structs
+#endif /* _MSC_VER */
#define ACE_HAS_UNICODE
@@ -131,4 +214,7 @@ inline void *operator new (unsigned int, void *p) { return p; }
#define ACE_NEEDS_WRITEV
#define ACE_NEEDS_READV
+// Compiler/Platform supports the "using" keyword.
+// #define ACE_HAS_USING_KEYWORD
+
#endif /* ACE_CONFIG_H */
diff --git a/ace/config-win32-msvc4.0.h b/ace/config-win32-msvc4.0.h
index bc0dcfa9f98..050a3776dbe 100644
--- a/ace/config-win32-msvc4.0.h
+++ b/ace/config-win32-msvc4.0.h
@@ -7,14 +7,23 @@
#if !defined (ACE_CONFIG_H)
#define ACE_CONFIG_H
+#if !defined (ACE_CONFIG_H)
+#define ACE_CONFIG_H
+
#if defined (_MSC_VER)
// "C4355: 'this' : used in base member initializer list"
#pragma warning(disable:4355) // disable C4514 warning
-// #pragma warning(default:4355) // use this to reenable, if desired
+// #pragma warning(default:4355) // use this to reenable, if desired
+
+#pragma warning(disable:4201) // winnt.h uses nameless structs
#endif /* _MSC_VER */
-// While digging the MSVC 4.0 include files, I found how to disable MSVC
-// warnings:
-// --Amos Shapira
+
+// While digging the MSVC 4.0 include files, I found how to disable
+// MSVC warnings: --Amos Shapira
+
+// Comment this out for now since it will break existing application
+// code.
+// #define ACE_HAS_STRICT
// <windows.h> and MFC's <afxwin.h> are mutually
// incompatible. <windows.h> is brain-dead about MFC; it doesn't check
@@ -30,35 +39,60 @@
// advantage of all this to select the proper support for winsock. -
// trl 26-July-1996
-#ifdef _AFXDLL // May be defined by MSVC++ IDE
-#include /**/ <afxwin.h> // He is doing MFC
-#define _INC_WINDOWS // Prevent winsock.h from including windows.h
-#endif
-#ifdef _WINDLL // May be defined by MSVC++ IDE
+// This is necessary since MFC users apparently can't #include
+// <windows.h> directly.
+#if defined (_AFXDLL) || defined (_WINDLL)
#include /**/ <afxwin.h> // He is doing MFC
-#define _INC_WINDOWS // Prevent winsock.h from including windows.h
+ // Windows.h will be included via afxwin.h->afx.h->afx_ver_.h->afxv_w32.h
+ // #define _INC_WINDOWS // Prevent winsock.h from including windows.h
#endif
-#ifndef __AFX_H__ // set in afxwin.h
-#include /**/ <windows.h> // if he's not doing MFC, snag this
-#endif
-
-// Define the following two macros if you're compiling with WinSock 2.0.
+#if !defined (_INC_WINDOWS) // Already include windows.h ?
+ // Must define strict before including windows.h !
+#if defined (ACE_HAS_STRICT)
+#define STRICT 1
+#endif /* ACE_HAS_STRICT */
+
+#if !defined (WIN32_LEAN_AND_MEAN)
+#define WIN32_LEAN_AND_MEAN
+#endif /* WIN32_LEAN_AND_MEAN */
+
+#if defined (_UNICODE)
+#if !defined (UNICODE)
+#define UNICODE // UNICODE is used by Windows headers
+#endif /* UNICODE */
+#endif /* _UNICODE */
+
+#if defined (UNICODE)
+#if !defined (_UNICODE)
+#define _UNICODE // _UNICODE is used by C-runtime/MFC headers
+#endif /* _UNICODE */
+#endif /* UNICODE */
+#endif /* !defined (_INC_INWDOWS) */
+
+// Define the following macro if you're compiling with WinSock 2.0.
// #define ACE_HAS_WINSOCK2
-// #define ACE_WSOCK_VERSION 2, 0
-
-// Undefine the following macro if you're compiling with WinSock 2.0.
-// Version 1.1 of WinSock
-#define ACE_WSOCK_VERSION 1, 1
// Needed for timeval.
#if defined (ACE_HAS_WINSOCK2)
-#include /**/ <winsock2.h>
-#include "ace/ws2tcpip.h"
+#if !defined (_WINSOCK2API_)
+#include /**/ <winsock2.h> // will also include windows.h, if not present
+#endif /* _WINSOCK2API */
+
+#define ACE_WSOCK_VERSION 2, 0
#else
-#include /**/ <winsock.h>
+#if !defined (_WINSOCKAPI_)
+#include /**/ <winsock.h> // will also include windows.h, if not present
+#endif /* _WINSOCKAPI */
+
+// Version 1.1 of WinSock
+#define ACE_WSOCK_VERSION 1, 1
#endif /* ACE_HAS_WINSOCK2 */
+#if defined (_MSC_VER)
+#pragma warning(default: 4201) // winnt.h uses nameless structs
+#endif /* _MSC_VER */
+
#define ACE_HAS_UNICODE
#define ACE_HAS_STL
@@ -180,7 +214,7 @@
#define ACE_NEEDS_WRITEV
#define ACE_NEEDS_READV
-// Comment this out for now since it will break existing application
-// code.
-#define ACE_HAS_STRICT
+// Compiler/Platform supports the "using" keyword.
+#define ACE_HAS_USING_KEYWORD
+
#endif /* ACE_CONFIG_H */