From 3bff6f8cfd6330e506e5f5f86a90fc2f02dd6191 Mon Sep 17 00:00:00 2001 From: Erik Sohns Date: Tue, 1 Dec 2015 19:35:34 +0100 Subject: [PATCH 01/22] improved solaris 11 support --- ACE/ace/OS_NS_pwd.inl | 8 ++++++++ ACE/ace/config-sunos5.11.h | 3 +++ 2 files changed, 11 insertions(+) diff --git a/ACE/ace/OS_NS_pwd.inl b/ACE/ace/OS_NS_pwd.inl index 3d680bba97b02..a6e0d43d0f647 100644 --- a/ACE/ace/OS_NS_pwd.inl +++ b/ACE/ace/OS_NS_pwd.inl @@ -56,6 +56,14 @@ ACE_OS::getpwnam_r (const char *name, } *result = pwd; return 0; +#elif defined (ACE_HAS_SOLARIS11_GETPWNAM_R) + if (::getpwnam_r (name, pwd, buffer, bufsize) == 0) + { + *result = 0; + return -1; + } + *result = pwd; + return 0; #elif defined (ACE_HAS_STHREADS) if (::getpwnam_r (name, pwd, buffer, bufsize) != 0) { diff --git a/ACE/ace/config-sunos5.11.h b/ACE/ace/config-sunos5.11.h index 07f8b679f3b2b..3cb88aca708af 100644 --- a/ACE/ace/config-sunos5.11.h +++ b/ACE/ace/config-sunos5.11.h @@ -10,4 +10,7 @@ // #include the SunOS 5.10 config, then add any SunOS 5.11 updates below. #include "ace/config-sunos5.10.h" +// *TODO*: find out how far this also hold for previous solaris releases +#define ACE_HAS_SOLARIS11_GETPWNAM_R + #endif /* ACE_CONFIG_H */ From 6cec72188dd5c94b43ce4dcc72fcf87b62f3ef88 Mon Sep 17 00:00:00 2001 From: Erik Sohns Date: Tue, 1 Dec 2015 19:36:18 +0100 Subject: [PATCH 02/22] fix problem with std io when using ACE_OSTREAM_TYPE --- ACE/ace/config-macros.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ACE/ace/config-macros.h b/ACE/ace/config-macros.h index 2fae4892abd9b..b1d859fff7135 100644 --- a/ACE/ace/config-macros.h +++ b/ACE/ace/config-macros.h @@ -49,7 +49,11 @@ # if defined (ACE_LACKS_IOSTREAM_TOTALLY) # define ACE_OSTREAM_TYPE FILE # else /* ! ACE_LACKS_IOSTREAM_TOTALLY */ +# if defined ACE_USES_STD_NAMESPACE_FOR_STDCPP_LIB +# define ACE_OSTREAM_TYPE std::ostream +# else # define ACE_OSTREAM_TYPE ostream +# endif /* ! ACE_USES_STD_NAMESPACE_FOR_STDCPP_LIB */ # endif /* ! ACE_LACKS_IOSTREAM_TOTALLY */ #endif /* ! ACE_OSTREAM_TYPE */ From 502c6fce4c245da42c885a1e85c5821de282a2d4 Mon Sep 17 00:00:00 2001 From: Erik Sohns Date: Tue, 1 Dec 2015 19:36:47 +0100 Subject: [PATCH 03/22] added support for CancelIoEx() (Win32) --- ACE/ace/WIN32_Asynch_IO.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/ACE/ace/WIN32_Asynch_IO.cpp b/ACE/ace/WIN32_Asynch_IO.cpp index d914ccfc463ad..7f3d9d6fbc420 100644 --- a/ACE/ace/WIN32_Asynch_IO.cpp +++ b/ACE/ace/WIN32_Asynch_IO.cpp @@ -175,7 +175,12 @@ ACE_WIN32_Asynch_Operation::cancel (void) // @@ This API returns 0 on failure. So, I am returning -1 in that // case. Is that right? (Alex). +#if (_WIN32_WINNT < 0x0600) int const result = (int) ::CancelIo (this->handle_); +#else + int const result = (int) ::CancelIoEx (this->handle_, + NULL); +#endif /* _WIN32_WINNT < 0x0600 */ if (result == 0) // Couldn't cancel the operations. From aeb68c0179483af8fb44fedf88c94549aaff3210 Mon Sep 17 00:00:00 2001 From: Erik Sohns Date: Wed, 2 Dec 2015 02:01:02 +0100 Subject: [PATCH 04/22] fixed an issue with (exported) template specializations (Win32) --- ACE/ace/Condition_Recursive_Thread_Mutex.cpp | 26 +++++++------------ ACE/ace/Condition_Recursive_Thread_Mutex.h | 15 +++++++++++ ACE/ace/Condition_Recursive_Thread_Mutex.inl | 16 ++++++++++++ ACE/ace/Future.h | 2 -- ACE/ace/Timer_Queue_Adapters.h | 2 +- ACE/examples/APG/ThreadPools/Futures.cpp | 3 +++ .../Thread_Timer_Queue_Custom_Handler_Test.h | 1 - .../Timer_Queue/Thread_Timer_Queue_Test.cpp | 3 ++- ACE/tests/Bug_2772_Regression_Test.cpp | 3 +++ ACE/tests/Recursive_Condition_Bug_Test.cpp | 3 +++ 10 files changed, 53 insertions(+), 21 deletions(-) create mode 100644 ACE/ace/Condition_Recursive_Thread_Mutex.inl diff --git a/ACE/ace/Condition_Recursive_Thread_Mutex.cpp b/ACE/ace/Condition_Recursive_Thread_Mutex.cpp index 2f68f8c8b36bc..4ffe00d194791 100644 --- a/ACE/ace/Condition_Recursive_Thread_Mutex.cpp +++ b/ACE/ace/Condition_Recursive_Thread_Mutex.cpp @@ -12,15 +12,15 @@ #if defined (ACE_HAS_THREADS) +#if !defined (__ACE_INLINE__) +#include "ace/Condition_Recursive_Thread_Mutex.inl" +#endif /* __ACE_INLINE__ */ + #include "ace/Log_Category.h" ACE_BEGIN_VERSIONED_NAMESPACE_DECL -int -ACE_Condition::remove (void) -{ - return ACE_OS::cond_destroy (&this->cond_); -} +ACE_ALLOC_HOOK_DEFINE (ACE_Condition) void ACE_Condition::dump (void) const @@ -37,11 +37,6 @@ ACE_Condition::dump (void) const #endif /* ACE_HAS_DUMP */ } -ACE_Condition::~ACE_Condition (void) -{ - this->remove (); -} - ACE_Condition::ACE_Condition (ACE_Recursive_Thread_Mutex &m) : mutex_ (m) { @@ -60,6 +55,11 @@ ACE_Condition::ACE_Condition (ACE_Recursive_Thread_M ACE_TEXT ("ACE_Condition::ACE_Condition"))); } +ACE_Condition::~ACE_Condition (void) +{ + this->remove (); +} + int ACE_Condition::wait (const ACE_Time_Value *abstime) { @@ -120,12 +120,6 @@ ACE_Condition::broadcast (void) return ACE_OS::cond_broadcast (&this->cond_); } -ACE_Recursive_Thread_Mutex & -ACE_Condition::mutex (void) -{ - return this->mutex_; -} - ACE_END_VERSIONED_NAMESPACE_DECL #endif /* ACE_HAS_THREADS */ diff --git a/ACE/ace/Condition_Recursive_Thread_Mutex.h b/ACE/ace/Condition_Recursive_Thread_Mutex.h index a7ce9944cc56b..8061f3b3d636e 100644 --- a/ACE/ace/Condition_Recursive_Thread_Mutex.h +++ b/ACE/ace/Condition_Recursive_Thread_Mutex.h @@ -23,12 +23,17 @@ #if !defined (ACE_HAS_THREADS) # include "ace/Null_Condition.h" #else /* ACE_HAS_THREADS */ +// ACE platform supports some form of threading. + #include "ace/Recursive_Thread_Mutex.h" #include "ace/Condition_Attributes.h" #include "ace/Condition_T.h" ACE_BEGIN_VERSIONED_NAMESPACE_DECL +class ACE_Time_Value; + +#if defined (ACE_BUILD_DLL) /** * @brief ACE_Condition template specialization written using * @a ACE_Recursive_Thread_Mutex. This allows threads to block until @@ -86,6 +91,9 @@ class ACE_Export ACE_Condition /// Dump the state of an object. void dump (void) const; + /// Declare the dynamic allocation hooks. + ACE_ALLOC_HOOK_DECLARE; + private: // = Prevent assignment and copying. @@ -101,11 +109,18 @@ class ACE_Export ACE_Condition ACE_Recursive_Thread_Mutex &mutex_; }; +#else +extern template ACE_Export class ACE_Condition; +#endif typedef ACE_Condition ACE_Condition_Recursive_Thread_Mutex; ACE_END_VERSIONED_NAMESPACE_DECL +#if defined (__ACE_INLINE__) +#include "ace/Condition_Recursive_Thread_Mutex.inl" +#endif /* __ACE_INLINE__ */ + #endif /* !ACE_HAS_THREADS */ #include /**/ "ace/post.h" diff --git a/ACE/ace/Condition_Recursive_Thread_Mutex.inl b/ACE/ace/Condition_Recursive_Thread_Mutex.inl new file mode 100644 index 0000000000000..44e4e09c3a7ba --- /dev/null +++ b/ACE/ace/Condition_Recursive_Thread_Mutex.inl @@ -0,0 +1,16 @@ +// -*- C++ -*- +ACE_BEGIN_VERSIONED_NAMESPACE_DECL + +ACE_INLINE int +ACE_Condition::remove (void) +{ + return ACE_OS::cond_destroy (&this->cond_); +} + +ACE_INLINE ACE_Recursive_Thread_Mutex & +ACE_Condition::mutex (void) +{ + return this->mutex_; +} + +ACE_END_VERSIONED_NAMESPACE_DECL diff --git a/ACE/ace/Future.h b/ACE/ace/Future.h index c83fae41a475d..1ed39ab50fe30 100644 --- a/ACE/ace/Future.h +++ b/ACE/ace/Future.h @@ -26,8 +26,6 @@ #if defined (ACE_HAS_THREADS) #include "ace/Synch_Traits.h" -#include "ace/Recursive_Thread_Mutex.h" -#include "ace/Condition_Recursive_Thread_Mutex.h" ACE_BEGIN_VERSIONED_NAMESPACE_DECL diff --git a/ACE/ace/Timer_Queue_Adapters.h b/ACE/ace/Timer_Queue_Adapters.h index a92a260cd2ffd..4704de6d4e933 100644 --- a/ACE/ace/Timer_Queue_Adapters.h +++ b/ACE/ace/Timer_Queue_Adapters.h @@ -21,7 +21,7 @@ #include "ace/Signal.h" #include "ace/Sig_Handler.h" -#include "ace/Condition_Recursive_Thread_Mutex.h" +#include "ace/Synch_Traits.h" #if defined (ACE_HAS_DEFERRED_TIMER_COMMANDS) # include "ace/Unbounded_Queue.h" diff --git a/ACE/examples/APG/ThreadPools/Futures.cpp b/ACE/examples/APG/ThreadPools/Futures.cpp index c207c734828b3..1ba647922628c 100644 --- a/ACE/examples/APG/ThreadPools/Futures.cpp +++ b/ACE/examples/APG/ThreadPools/Futures.cpp @@ -12,6 +12,9 @@ #include "ace/Activation_Queue.h" #include "ace/Condition_T.h" +// *NOTE*: explicit template instantiation required here... +template class ACE_Condition; + #define OUTSTANDING_REQUESTS 20 // Listing 2 code/ch16 diff --git a/ACE/examples/Timer_Queue/Thread_Timer_Queue_Custom_Handler_Test.h b/ACE/examples/Timer_Queue/Thread_Timer_Queue_Custom_Handler_Test.h index 5ccb0e01bff48..a412ac358cf69 100644 --- a/ACE/examples/Timer_Queue/Thread_Timer_Queue_Custom_Handler_Test.h +++ b/ACE/examples/Timer_Queue/Thread_Timer_Queue_Custom_Handler_Test.h @@ -26,7 +26,6 @@ #include "ace/Timer_Heap_T.h" #include "ace/Timer_Queue_Adapters.h" #include "ace/svc_export.h" -#include "ace/Condition_Recursive_Thread_Mutex.h" #include "Driver.h" #include "Custom_Handler.h" diff --git a/ACE/examples/Timer_Queue/Thread_Timer_Queue_Test.cpp b/ACE/examples/Timer_Queue/Thread_Timer_Queue_Test.cpp index 03471912ad9b0..d46c084d69017 100644 --- a/ACE/examples/Timer_Queue/Thread_Timer_Queue_Test.cpp +++ b/ACE/examples/Timer_Queue/Thread_Timer_Queue_Test.cpp @@ -22,7 +22,8 @@ #include "ace/Condition_T.h" #include "ace/Thread_Mutex.h" - +// *NOTE*: explicit template instantiation required here... +template class ACE_Condition; // Administrivia methods... Handler::Handler(const ACE_Time_Value &expiration_time) diff --git a/ACE/tests/Bug_2772_Regression_Test.cpp b/ACE/tests/Bug_2772_Regression_Test.cpp index 14c948de6d7a4..f2a98427128e3 100644 --- a/ACE/tests/Bug_2772_Regression_Test.cpp +++ b/ACE/tests/Bug_2772_Regression_Test.cpp @@ -16,6 +16,9 @@ #include "ace/Condition_Recursive_Thread_Mutex.h" #include "ace/Thread.h" +// *NOTE*: explicit template instantiation required here... +template class ACE_Condition; + class ThreadTest { public: diff --git a/ACE/tests/Recursive_Condition_Bug_Test.cpp b/ACE/tests/Recursive_Condition_Bug_Test.cpp index 365c80209ed9e..1513b583c5ef3 100644 --- a/ACE/tests/Recursive_Condition_Bug_Test.cpp +++ b/ACE/tests/Recursive_Condition_Bug_Test.cpp @@ -23,6 +23,9 @@ #include "ace/Timer_Queue_Adapters.h" #include "ace/Condition_Recursive_Thread_Mutex.h" +// *NOTE*: explicit template instantiation required here... +template class ACE_Condition; + #if defined (ACE_HAS_THREADS) // Number of iterations for the performance tests. From de13b795434877ad71f77a74180c2a01141083b2 Mon Sep 17 00:00:00 2001 From: Erik Sohns Date: Wed, 2 Dec 2015 14:53:29 +0100 Subject: [PATCH 05/22] fix potential memory leak when using the Win32 Proactor (part1) --- ACE/ace/WIN32_Proactor.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/ACE/ace/WIN32_Proactor.cpp b/ACE/ace/WIN32_Proactor.cpp index 25bf4f31b324e..c593398cc2634 100644 --- a/ACE/ace/WIN32_Proactor.cpp +++ b/ACE/ace/WIN32_Proactor.cpp @@ -636,6 +636,12 @@ ACE_WIN32_Proactor::application_specific_code (ACE_WIN32_Asynch_Result *asynch_r const void *completion_key, u_long error) { + // *NOTE*: on Win32 with MSVC (ACE_HAS_WIN32_STRUCTURAL_EXCEPTIONS set), this + // needs to be compiled with '/EHa' to work properly, otherwise + // 'finally' is skipped, leaking memory + // *TODO*: the default (auto-)generated MPC MSVC project files do not enforce + // this (uses '/EHsc', see $MPC_ROOT/templates/nmakedll.mpt:36) + // *WORKAROUND*: #undef(ine) ACE_HAS_WIN32_STRUCTURAL_EXCEPTIONS in config.h ACE_SEH_TRY { // Call completion hook From 7acfc9e6f746a4b57f5e62847218a1552ea6be52 Mon Sep 17 00:00:00 2001 From: Erik Sohns Date: Thu, 3 Dec 2015 03:37:48 +0100 Subject: [PATCH 06/22] repaired include strategy for ace/Synch.h (prerequisite to solving template instantiation issues on Win32) --- ACE/ace/Synch.h | 4 ++++ ACE/apps/JAWS3/http/HTTP_Service_Handler.h | 4 ++-- ACE/apps/JAWS3/jaws3/Cached_Allocator_T.h | 4 ++-- ACE/apps/JAWS3/jaws3/Config_File.cpp | 5 +++-- ACE/apps/JAWS3/jaws3/Datagram.h | 2 +- ACE/apps/JAWS3/jaws3/Options.h | 2 +- ACE/apps/JAWS3/jaws3/Signal_Task.h | 2 +- ACE/apps/JAWS3/jaws3/Symbol_Table.cpp | 2 ++ ACE/apps/JAWS3/jaws3/Symbol_Table.h | 2 +- ACE/apps/JAWS3/small/SS_Service_Handler.h | 4 ++-- ACE/examples/APG/Logging/LogManager.h | 7 ++++--- ACE/examples/APG/Logging/Use_LogManager.cpp | 3 +++ ACE/examples/APG/ThreadSafety/ClientContext.h | 4 ++-- ACE/examples/APG/Threads/Message_Receiver.h | 2 +- ACE/examples/APG/Timers/PTimerDispatcher.h | 5 +++-- ACE/examples/APG/Timers/TimerDispatcher.h | 5 +++-- ACE/examples/APG/Timers/Upcall.h | 6 +++--- ACE/examples/C++NPv2/TP_Logging_Server.cpp | 2 ++ ACE/examples/C++NPv2/TP_Logging_Server.h | 5 +++-- .../Timer_Queue/Thread_Timer_Queue_Test.h | 14 ++++++------- ACE/protocols/ace/HTBP/HTBP_Addr.h | 1 - ACE/protocols/ace/HTBP/HTBP_Channel.cpp | 9 ++++---- ACE/protocols/ace/HTBP/HTBP_Channel.h | 1 + ACE/protocols/ace/HTBP/HTBP_Filter.cpp | 6 +++--- .../ace/HTBP/HTBP_Inside_Squid_Filter.cpp | 10 +++++---- ACE/protocols/ace/HTBP/HTBP_Notifier.cpp | 5 ++++- .../ace/HTBP/HTBP_Outside_Squid_Filter.cpp | 8 ++++--- ACE/protocols/ace/HTBP/HTBP_Session.cpp | 17 ++++++++------- ACE/protocols/ace/HTBP/HTBP_Session.h | 4 ++-- ACE/protocols/ace/HTBP/HTBP_Stream.cpp | 7 ++++--- ACE/protocols/ace/TMCast/LinkListener.hpp | 13 ++++++------ ACE/protocols/ace/TMCast/Messaging.hpp | 6 +++--- .../ace/TMCast/TransactionController.hpp | 6 +++--- .../tests/HTBP/Reactor_Tests/client.cpp | 4 +++- .../tests/HTBP/Reactor_Tests/server.cpp | 20 +++++++++--------- .../tests/HTBP/Reactor_Tests/test_config.h | 9 ++++---- .../tests/HTBP/Send_Large_Msg/client.cpp | 9 ++++---- .../tests/HTBP/Send_Large_Msg/server.cpp | 15 ++++++------- .../tests/HTBP/Send_Recv_Tests/client.cpp | 17 ++++++++------- .../tests/HTBP/Send_Recv_Tests/server.cpp | 21 ++++++++++--------- ACE/protocols/tests/HTBP/ping/client.cpp | 2 ++ ACE/protocols/tests/HTBP/ping/server.cpp | 15 ++++++------- ACE/tests/Recursive_Condition_Bug_Test.cpp | 8 +++---- ACE/tests/Recursive_Condition_Test.cpp | 15 +++++++------ ACE/tests/Refcounted_Auto_Ptr_Test.h | 2 +- 45 files changed, 176 insertions(+), 138 deletions(-) diff --git a/ACE/ace/Synch.h b/ACE/ace/Synch.h index 6a6bf79425899..5843c28fa8d21 100644 --- a/ACE/ace/Synch.h +++ b/ACE/ace/Synch.h @@ -20,6 +20,10 @@ # pragma once #endif /* ACE_LACKS_PRAGMA_ONCE */ +// *NOTE*: never never never ever #include this file in a header +// --> #include "ace/Synch_Traits.h" instead and #include "ace/Synch.h" +// in the .cpp. This prevents multiple implicit template +// instantiations (linker errors on MSVC) #if !defined (DO_NOT_INCLUDE_SYNCH_H) /* All the classes have been moved out into their own headers as part of diff --git a/ACE/apps/JAWS3/http/HTTP_Service_Handler.h b/ACE/apps/JAWS3/http/HTTP_Service_Handler.h index c8df6d3eba145..cab6cff8e647b 100644 --- a/ACE/apps/JAWS3/http/HTTP_Service_Handler.h +++ b/ACE/apps/JAWS3/http/HTTP_Service_Handler.h @@ -2,10 +2,10 @@ #ifndef JAWS_HTTP_SERVICE_HANDLER_H #define JAWS_HTTP_SERVICE_HANDLER_H -#include "ace/Synch.h" #include "ace/Acceptor.h" -#include "ace/Svc_Handler.h" #include "ace/SOCK_Acceptor.h" +#include "ace/Svc_Handler.h" +#include "ace/Synch_Traits.h" #include "jaws3/Protocol_Handler.h" diff --git a/ACE/apps/JAWS3/jaws3/Cached_Allocator_T.h b/ACE/apps/JAWS3/jaws3/Cached_Allocator_T.h index 67082e2bad644..30f39013db81b 100644 --- a/ACE/apps/JAWS3/jaws3/Cached_Allocator_T.h +++ b/ACE/apps/JAWS3/jaws3/Cached_Allocator_T.h @@ -3,9 +3,9 @@ #define JAWS_CACHED_ALLOCATOR_T_H #include "ace/ACE.h" -#include "ace/Synch.h" -#include "ace/Malloc.h" #include "ace/Free_List.h" +#include "ace/Malloc.h" +#include "ace/Synch_Traits.h" #define JAWS_DEFAULT_ALLOCATOR_CHUNKS 10 #define JAWS_CACHED_ALLOCATOR(T) \ diff --git a/ACE/apps/JAWS3/jaws3/Config_File.cpp b/ACE/apps/JAWS3/jaws3/Config_File.cpp index ff2fa889489e2..9bff39efe2ab0 100644 --- a/ACE/apps/JAWS3/jaws3/Config_File.cpp +++ b/ACE/apps/JAWS3/jaws3/Config_File.cpp @@ -1,8 +1,9 @@ -#include "ace/OS_NS_stdlib.h" -#include "ace/OS_NS_string.h" #include "ace/FILE_Connector.h" #include "ace/Message_Block.h" +#include "ace/OS_NS_stdlib.h" +#include "ace/OS_NS_string.h" #include "ace/Singleton.h" +#include "ace/Synch.h" #include "ace/Unbounded_Queue.h" #ifndef JAWS_BUILD_DLL diff --git a/ACE/apps/JAWS3/jaws3/Datagram.h b/ACE/apps/JAWS3/jaws3/Datagram.h index 244c1a35f7938..dda46d5a418b7 100644 --- a/ACE/apps/JAWS3/jaws3/Datagram.h +++ b/ACE/apps/JAWS3/jaws3/Datagram.h @@ -3,9 +3,9 @@ #define JAWS_DATAGRAM_H #include "ace/Addr.h" -#include "ace/Synch.h" #include "ace/Singleton.h" #include "ace/SOCK_Dgram.h" +#include "ace/Synch_Traits.h" #include "jaws3/Export.h" #include "jaws3/Event_Completer.h" diff --git a/ACE/apps/JAWS3/jaws3/Options.h b/ACE/apps/JAWS3/jaws3/Options.h index 3f9d847475b4b..f419ecd4813d7 100644 --- a/ACE/apps/JAWS3/jaws3/Options.h +++ b/ACE/apps/JAWS3/jaws3/Options.h @@ -3,7 +3,7 @@ #define JAWS_OPTIONS_H #include "ace/Singleton.h" -#include "ace/Synch.h" +#include "ace/Synch_Traits.h" #include "jaws3/Export.h" #include "jaws3/Config_File.h" diff --git a/ACE/apps/JAWS3/jaws3/Signal_Task.h b/ACE/apps/JAWS3/jaws3/Signal_Task.h index 242db3f9f8aad..5cb83a14c06f8 100644 --- a/ACE/apps/JAWS3/jaws3/Signal_Task.h +++ b/ACE/apps/JAWS3/jaws3/Signal_Task.h @@ -2,9 +2,9 @@ #ifndef JAWS_SIGNAL_TASK_H #define JAWS_SIGNAL_TASK_H -#include "ace/Synch.h" #include "ace/Signal.h" #include "ace/Singleton.h" +#include "ace/Synch_Traits.h" #include "jaws3/Export.h" diff --git a/ACE/apps/JAWS3/jaws3/Symbol_Table.cpp b/ACE/apps/JAWS3/jaws3/Symbol_Table.cpp index 7c187498c3d22..936d5eaf55470 100644 --- a/ACE/apps/JAWS3/jaws3/Symbol_Table.cpp +++ b/ACE/apps/JAWS3/jaws3/Symbol_Table.cpp @@ -2,6 +2,8 @@ #define JAWS_BUILD_DLL #endif +#include "ace/Synch.h" + #include "jaws3/Symbol_Table.h" JAWS_Symbol_Table::JAWS_Symbol_Table (size_t size) diff --git a/ACE/apps/JAWS3/jaws3/Symbol_Table.h b/ACE/apps/JAWS3/jaws3/Symbol_Table.h index 346509e57f31f..0b1ff507926fb 100644 --- a/ACE/apps/JAWS3/jaws3/Symbol_Table.h +++ b/ACE/apps/JAWS3/jaws3/Symbol_Table.h @@ -3,7 +3,7 @@ #define JAWS_SYMBOL_TABLE_H #include "ace/Hash_Map_Manager.h" -#include "ace/Synch.h" +#include "ace/Synch_Traits.h" #include "jaws3/Export.h" diff --git a/ACE/apps/JAWS3/small/SS_Service_Handler.h b/ACE/apps/JAWS3/small/SS_Service_Handler.h index a7e49ba2d8dfb..f7068f5462665 100644 --- a/ACE/apps/JAWS3/small/SS_Service_Handler.h +++ b/ACE/apps/JAWS3/small/SS_Service_Handler.h @@ -2,11 +2,11 @@ #ifndef TERA_SS_SERVICE_HANDLER_H #define TERA_SS_SERVICE_HANDLER_H -#include "ace/Synch.h" #include "ace/Acceptor.h" -#include "ace/Svc_Handler.h" #include "ace/SOCK_Acceptor.h" #include "ace/svc_export.h" +#include "ace/Svc_Handler.h" +#include "ace/Synch_Traits.h" #include "jaws3/Protocol_Handler.h" diff --git a/ACE/examples/APG/Logging/LogManager.h b/ACE/examples/APG/Logging/LogManager.h index 523abff55d84d..d1689d7d3aa7c 100644 --- a/ACE/examples/APG/Logging/LogManager.h +++ b/ACE/examples/APG/Logging/LogManager.h @@ -1,8 +1,9 @@ #include "ace/streams.h" -#include "ace/Synch.h" -#include "ace/Singleton.h" + #include "ace/Log_Msg.h" #include "ace/Log_Msg_Callback.h" +#include "ace/Singleton.h" +#include "ace/Synch_Traits.h" #ifndef LOG_MANAGER_H #define LOG_MANAGER_H @@ -92,7 +93,7 @@ LogManager::redirectToCallback (ACE_Log_Msg_Callback * callback) // Listing 2 // Listing 3 code/ch03 -typedef ACE_Singleton +typedef ACE_Singleton LogManagerSingleton; #define LOG_MANAGER LogManagerSingleton::instance() // Listing 3 diff --git a/ACE/examples/APG/Logging/Use_LogManager.cpp b/ACE/examples/APG/Logging/Use_LogManager.cpp index d7b7c3607d91e..afc23cc1f6daa 100644 --- a/ACE/examples/APG/Logging/Use_LogManager.cpp +++ b/ACE/examples/APG/Logging/Use_LogManager.cpp @@ -1,3 +1,6 @@ + +#include "ace/Synch.h" + #include "LogManager.h" // Listing 1 code/ch03 diff --git a/ACE/examples/APG/ThreadSafety/ClientContext.h b/ACE/examples/APG/ThreadSafety/ClientContext.h index 168d4824bc2fa..f013ffe963a52 100644 --- a/ACE/examples/APG/ThreadSafety/ClientContext.h +++ b/ACE/examples/APG/ThreadSafety/ClientContext.h @@ -7,9 +7,9 @@ #define __CLIENTCONTEXT_H_ #include "ace/Hash_Map_Manager.h" -#include "ace/Synch.h" +#include "ace/Synch_Traits.h" -typedef ACE_Hash_Map_Manager +typedef ACE_Hash_Map_Manager Map; // Listing 1 code/ch14 diff --git a/ACE/examples/APG/Threads/Message_Receiver.h b/ACE/examples/APG/Threads/Message_Receiver.h index 92f1ab612561f..4697f54f026fb 100644 --- a/ACE/examples/APG/Threads/Message_Receiver.h +++ b/ACE/examples/APG/Threads/Message_Receiver.h @@ -10,7 +10,7 @@ #include "ace/Message_Block.h" #include "ace/SOCK_Stream.h" #include "ace/Svc_Handler.h" -#include "ace/Synch.h" +#include "ace/Synch_Traits.h" #include "ace/Task.h" // Listing 1 code/ch12 diff --git a/ACE/examples/APG/Timers/PTimerDispatcher.h b/ACE/examples/APG/Timers/PTimerDispatcher.h index 43047c67a8aa1..1954d3fd65dab 100644 --- a/ACE/examples/APG/Timers/PTimerDispatcher.h +++ b/ACE/examples/APG/Timers/PTimerDispatcher.h @@ -2,8 +2,9 @@ #if !defined(PTIMER_DISPATCHER_H) #define PTIMER_DISPATCHER_H +#include "ace/Event.h" #include "ace/Singleton.h" -#include "ace/Synch.h" // needed for ACE_Event +#include "ace/Synch_Traits.h" #include "Upcall.h" class PCB; @@ -31,7 +32,7 @@ class PTimer_Dispatcher ACE_Event timer_; }; -typedef ACE_Singleton PTimer; +typedef ACE_Singleton PTimer; #endif /*TIMER_DISPATCHER_H*/ diff --git a/ACE/examples/APG/Timers/TimerDispatcher.h b/ACE/examples/APG/Timers/TimerDispatcher.h index 06ce42a8d8a1c..e587ab6fb0575 100644 --- a/ACE/examples/APG/Timers/TimerDispatcher.h +++ b/ACE/examples/APG/Timers/TimerDispatcher.h @@ -2,9 +2,10 @@ #if !defined(TIMER_DISPATCHER_H) #define TIMER_DISPATCHER_H +#include "ace/Event.h" #include "ace/Event_Handler.h" #include "ace/Singleton.h" -#include "ace/Synch.h" // needed for ACE_Event +#include "ace/Synch_Traits.h" #include "ace/Timer_Queue.h" // Listing 1 code/ch20 @@ -31,7 +32,7 @@ class Timer_Dispatcher ACE_Event timer_; }; -typedef ACE_Singleton Timer; +typedef ACE_Singleton Timer; // Listing 1 #endif /*TIMER_DISPATCHER_H*/ diff --git a/ACE/examples/APG/Timers/Upcall.h b/ACE/examples/APG/Timers/Upcall.h index 5b2c1c7593e10..07e2e7c4afb8e 100644 --- a/ACE/examples/APG/Timers/Upcall.h +++ b/ACE/examples/APG/Timers/Upcall.h @@ -2,21 +2,21 @@ #if !defined(UPCALL_H) #define UPCALL_H +#include "ace/Synch_Traits.h" #include "ace/Timer_Queue_T.h" #include "ace/Timer_Heap_T.h" -#include "ace/Synch.h" #include "PCB.h" // Listing 1 code/ch20 class UpcallHandler; -typedef ACE_Timer_Queue_T +typedef ACE_Timer_Queue_T PTimerQueue; // Create a special heap-based timer queue that allows you to // control exactly how timer evetns are handled. -typedef ACE_Timer_Heap_T +typedef ACE_Timer_Heap_T PTimerHeap; // Listing 1 diff --git a/ACE/examples/C++NPv2/TP_Logging_Server.cpp b/ACE/examples/C++NPv2/TP_Logging_Server.cpp index 10bb93f05865d..832110af219ec 100644 --- a/ACE/examples/C++NPv2/TP_Logging_Server.cpp +++ b/ACE/examples/C++NPv2/TP_Logging_Server.cpp @@ -5,6 +5,8 @@ #include "ace/OS_Memory.h" #include "ace/Guard_T.h" #include "ace/Message_Block.h" +#include "ace/Synch.h" + #include "TP_Logging_Server.h" int TP_Logging_Handler::handle_input (ACE_HANDLE) { diff --git a/ACE/examples/C++NPv2/TP_Logging_Server.h b/ACE/examples/C++NPv2/TP_Logging_Server.h index 0f0ca357b76e4..a4b1ac67f3a08 100644 --- a/ACE/examples/C++NPv2/TP_Logging_Server.h +++ b/ACE/examples/C++NPv2/TP_Logging_Server.h @@ -7,8 +7,9 @@ #include "ace/Auto_Ptr.h" #include "ace/Singleton.h" -#include "ace/Synch.h" +#include "ace/Synch_Traits.h" #include "ace/Task.h" + #include "Logging_Acceptor.h" #include "Logging_Event_Handler.h" #include "Reactor_Logging_Server_T.h" @@ -29,7 +30,7 @@ class TP_Logging_Task : public ACE_Task { virtual int svc (void); }; -typedef ACE_Unmanaged_Singleton +typedef ACE_Unmanaged_Singleton TP_LOGGING_TASK; /*******************************************************/ diff --git a/ACE/examples/Timer_Queue/Thread_Timer_Queue_Test.h b/ACE/examples/Timer_Queue/Thread_Timer_Queue_Test.h index 97446bf213ce0..b60715527139c 100644 --- a/ACE/examples/Timer_Queue/Thread_Timer_Queue_Test.h +++ b/ACE/examples/Timer_Queue/Thread_Timer_Queue_Test.h @@ -16,18 +16,18 @@ #ifndef _THREAD_TIMER_QUEUE_TEST_H_ #define _THREAD_TIMER_QUEUE_TEST_H_ -#include "ace/Task.h" - #if !defined (ACE_LACKS_PRAGMA_ONCE) # pragma once #endif /* ACE_LACKS_PRAGMA_ONCE */ -#include "ace/Null_Mutex.h" +#include "ace/Event_Handler_Handle_Timeout_Upcall.h" +#include "ace/Synch_Traits.h" +#include "ace/Task.h" +#include "ace/Time_Value.h" #include "ace/Timer_Heap_T.h" #include "ace/Timer_Queue_Adapters.h" #include "ace/svc_export.h" -#include "ace/Condition_Recursive_Thread_Mutex.h" -#include "ace/Event_Handler_Handle_Timeout_Upcall.h" + #include "Driver.h" // These typedefs ensure that we use the minimal amount of locking @@ -36,11 +36,11 @@ typedef ACE_Event_Handler_Handle_Timeout_Upcall Upcall; typedef ACE_Timer_Heap_T + ACE_SYNCH_NULL_MUTEX> Timer_Heap; typedef ACE_Timer_Heap_Iterator_T + ACE_SYNCH_NULL_MUTEX> Timer_Heap_Iterator; typedef ACE_Thread_Timer_Queue_Adapter Thread_Timer_Queue; diff --git a/ACE/protocols/ace/HTBP/HTBP_Addr.h b/ACE/protocols/ace/HTBP/HTBP_Addr.h index 2cb7febf4dc39..0f6a1ba492aab 100644 --- a/ACE/protocols/ace/HTBP/HTBP_Addr.h +++ b/ACE/protocols/ace/HTBP/HTBP_Addr.h @@ -19,7 +19,6 @@ #endif /* ACE_LACKS_PRAGMA_ONCE */ #include "ace/INET_Addr.h" -#include "ace/Synch.h" #include "ace/SString.h" ACE_BEGIN_VERSIONED_NAMESPACE_DECL diff --git a/ACE/protocols/ace/HTBP/HTBP_Channel.cpp b/ACE/protocols/ace/HTBP/HTBP_Channel.cpp index 48d897875b0ca..93b2b67da6d5b 100644 --- a/ACE/protocols/ace/HTBP/HTBP_Channel.cpp +++ b/ACE/protocols/ace/HTBP/HTBP_Channel.cpp @@ -13,13 +13,14 @@ #include "HTBP_Channel.inl" #endif -#include "HTBP_Session.h" -#include "HTBP_Filter_Factory.h" - #include "ace/Message_Block.h" -#include "ace/Reactor.h" #include "ace/os_include/netinet/os_tcp.h" #include "ace/OS_NS_time.h" +#include "ace/Reactor.h" +#include "ace/Synch.h" + +#include "HTBP_Session.h" +#include "HTBP_Filter_Factory.h" ACE_BEGIN_VERSIONED_NAMESPACE_DECL diff --git a/ACE/protocols/ace/HTBP/HTBP_Channel.h b/ACE/protocols/ace/HTBP/HTBP_Channel.h index 87f2dd7785acc..30f895b32d821 100644 --- a/ACE/protocols/ace/HTBP/HTBP_Channel.h +++ b/ACE/protocols/ace/HTBP/HTBP_Channel.h @@ -12,6 +12,7 @@ #define ACE_HTBP_CHANNEL_H #include /**/ "ace/pre.h" +#include "ace/INET_Addr.h" #include "ace/SOCK_Stream.h" #include "ace/Message_Block.h" diff --git a/ACE/protocols/ace/HTBP/HTBP_Filter.cpp b/ACE/protocols/ace/HTBP/HTBP_Filter.cpp index dd32c94e6686f..4337dd04eb526 100644 --- a/ACE/protocols/ace/HTBP/HTBP_Filter.cpp +++ b/ACE/protocols/ace/HTBP/HTBP_Filter.cpp @@ -1,13 +1,13 @@ -#include "ace/Log_Msg.h" - -#include "HTBP_Session.h" #include "HTBP_Filter.h" #if !defined (__ACE_INLINE__) #include "HTBP_Filter.inl" #endif +#include "ace/Log_Msg.h" +#include "ace/Synch.h" +#include "HTBP_Session.h" ACE_BEGIN_VERSIONED_NAMESPACE_DECL diff --git a/ACE/protocols/ace/HTBP/HTBP_Inside_Squid_Filter.cpp b/ACE/protocols/ace/HTBP/HTBP_Inside_Squid_Filter.cpp index 82cf2d324add4..16d90ee08debe 100644 --- a/ACE/protocols/ace/HTBP/HTBP_Inside_Squid_Filter.cpp +++ b/ACE/protocols/ace/HTBP/HTBP_Inside_Squid_Filter.cpp @@ -1,13 +1,15 @@ -// ACE_HTBP_Filter.cpp -#include "ace/Log_Msg.h" -#include "ace/OS_NS_stdio.h" -#include "HTBP_Session.h" #include "HTBP_Inside_Squid_Filter.h" #if !defined (__ACE_INLINE__) #include "HTBP_Inside_Squid_Filter.inl" #endif +#include "ace/Log_Msg.h" +#include "ace/OS_NS_stdio.h" +#include "ace/Synch.h" + +#include "HTBP_Session.h" + ACE_BEGIN_VERSIONED_NAMESPACE_DECL ssize_t diff --git a/ACE/protocols/ace/HTBP/HTBP_Notifier.cpp b/ACE/protocols/ace/HTBP/HTBP_Notifier.cpp index 568dd8b4b25aa..f9096ce13e954 100644 --- a/ACE/protocols/ace/HTBP/HTBP_Notifier.cpp +++ b/ACE/protocols/ace/HTBP/HTBP_Notifier.cpp @@ -8,9 +8,12 @@ */ //============================================================================= #include "HTBP_Notifier.h" + +#include "ace/Reactor.h" +#include "ace/Synch.h" + #include "HTBP_Channel.h" #include "HTBP_Session.h" -#include "ace/Reactor.h" ACE_BEGIN_VERSIONED_NAMESPACE_DECL diff --git a/ACE/protocols/ace/HTBP/HTBP_Outside_Squid_Filter.cpp b/ACE/protocols/ace/HTBP/HTBP_Outside_Squid_Filter.cpp index 61d50294456ad..e024f6fa75b07 100644 --- a/ACE/protocols/ace/HTBP/HTBP_Outside_Squid_Filter.cpp +++ b/ACE/protocols/ace/HTBP/HTBP_Outside_Squid_Filter.cpp @@ -1,12 +1,14 @@ -#include "ace/Log_Msg.h" - -#include "HTBP_Session.h" #include "HTBP_Outside_Squid_Filter.h" #if !defined (__ACE_INLINE__) #include "HTBP_Outside_Squid_Filter.inl" #endif +#include "ace/Log_Msg.h" +#include "ace/Synch.h" + +#include "HTBP_Session.h" + ACE_BEGIN_VERSIONED_NAMESPACE_DECL ssize_t diff --git a/ACE/protocols/ace/HTBP/HTBP_Session.cpp b/ACE/protocols/ace/HTBP/HTBP_Session.cpp index 8bda293fe52a5..9ae6025601ad8 100644 --- a/ACE/protocols/ace/HTBP/HTBP_Session.cpp +++ b/ACE/protocols/ace/HTBP/HTBP_Session.cpp @@ -1,17 +1,18 @@ -// SOCK_Stream.cpp -#include "ace/Log_Msg.h" - +#include "ace/Synch.h" #include "HTBP_Session.h" -#include "ace/SOCK_Connector.h" -#include "ace/Event_Handler.h" -#include "ace/os_include/netinet/os_tcp.h" -#include "HTBP_Filter.h" -#include "HTBP_ID_Requestor.h" #if !defined (__ACE_INLINE__) #include "HTBP_Session.inl" #endif +#include "ace/Event_Handler.h" +#include "ace/Log_Msg.h" +#include "ace/os_include/netinet/os_tcp.h" +#include "ace/SOCK_Connector.h" + +#include "HTBP_Filter.h" +#include "HTBP_ID_Requestor.h" + ACE_BEGIN_VERSIONED_NAMESPACE_DECL ACE::HTBP::Session::Session_Map ACE::HTBP::Session::session_map_; diff --git a/ACE/protocols/ace/HTBP/HTBP_Session.h b/ACE/protocols/ace/HTBP/HTBP_Session.h index 7098bf0b8fa2b..aecdfe22e1e0d 100644 --- a/ACE/protocols/ace/HTBP/HTBP_Session.h +++ b/ACE/protocols/ace/HTBP/HTBP_Session.h @@ -12,10 +12,10 @@ #define ACE_HTBP_SESSION_H #include /**/ "ace/pre.h" -#include "ace/SOCK_IO.h" #include "ace/Hash_Map_Manager.h" -#include "ace/Synch.h" +#include "ace/Synch_Traits.h" #include "ace/Message_Queue.h" +#include "ace/SOCK_IO.h" #if !defined (ACE_LACKS_PRAGMA_ONCE) # pragma once diff --git a/ACE/protocols/ace/HTBP/HTBP_Stream.cpp b/ACE/protocols/ace/HTBP/HTBP_Stream.cpp index 77e7a3415b00d..f14c8e003f69a 100644 --- a/ACE/protocols/ace/HTBP/HTBP_Stream.cpp +++ b/ACE/protocols/ace/HTBP/HTBP_Stream.cpp @@ -9,10 +9,11 @@ //============================================================================= #include "HTBP_Stream.h" -#include "HTBP_Session.h" -#include "HTBP_Filter_Factory.h" - #include "ace/Message_Block.h" +#include "ace/Synch.h" + +#include "HTBP_Filter_Factory.h" +#include "HTBP_Session.h" ACE_BEGIN_VERSIONED_NAMESPACE_DECL diff --git a/ACE/protocols/ace/TMCast/LinkListener.hpp b/ACE/protocols/ace/TMCast/LinkListener.hpp index 76944d9d4c99c..7e4de5ba688ae 100644 --- a/ACE/protocols/ace/TMCast/LinkListener.hpp +++ b/ACE/protocols/ace/TMCast/LinkListener.hpp @@ -1,12 +1,11 @@ // author : Boris Kolpackov // OS primitives -#include -#include -#include -#include -#include - +#include "ace/OS_NS_string.h" +#include "ace/OS_NS_stdlib.h" +#include "ace/Refcounted_Auto_Ptr.h" +#include "ace/SOCK_Dgram_Mcast.h" +#include "ace/Synch_Traits.h" #include "Messaging.hpp" #include "Protocol.hpp" @@ -150,7 +149,7 @@ namespace ACE_TMCast private: // FUZZ: disable check_for_ACE_Guard - typedef ACE_Guard AutoLock; + typedef ACE_Guard AutoLock; // FUZZ: enable check_for_ACE_Guard ACE_hthread_t thread_; diff --git a/ACE/protocols/ace/TMCast/Messaging.hpp b/ACE/protocols/ace/TMCast/Messaging.hpp index 883f52273e5a5..f4046f0c68b74 100644 --- a/ACE/protocols/ace/TMCast/Messaging.hpp +++ b/ACE/protocols/ace/TMCast/Messaging.hpp @@ -3,8 +3,8 @@ #ifndef TMCAST_MESSAGING_HPP #define TMCAST_MESSAGING_HPP -#include -#include +#include "ace/Bound_Ptr.h" +#include "ace/Synch_Traits.h" #include "MTQueue.hpp" @@ -22,7 +22,7 @@ namespace ACE_TMCast MessagePtr; typedef - MTQueue > + MTQueue MessageQueue; struct MessageQueueAutoLock diff --git a/ACE/protocols/ace/TMCast/TransactionController.hpp b/ACE/protocols/ace/TMCast/TransactionController.hpp index 43ff7a9ee8c0c..57c601749ba5f 100644 --- a/ACE/protocols/ace/TMCast/TransactionController.hpp +++ b/ACE/protocols/ace/TMCast/TransactionController.hpp @@ -1,9 +1,9 @@ // author : Boris Kolpackov +#include "ace/Bound_Ptr.h" #include "ace/OS_NS_string.h" #include "ace/OS_NS_stdlib.h" -#include "ace/Synch.h" -#include "ace/Bound_Ptr.h" +#include "ace/Synch_Traits.h" #include "Protocol.hpp" #include "Messaging.hpp" @@ -366,7 +366,7 @@ namespace ACE_TMCast private: // FUZZ: disable check_for_ACE_Guard - typedef ACE_Guard AutoLock; + typedef ACE_Guard AutoLock; // FUZZ: enable check_for_ACE_Guard // bool trace_; diff --git a/ACE/protocols/tests/HTBP/Reactor_Tests/client.cpp b/ACE/protocols/tests/HTBP/Reactor_Tests/client.cpp index 4716ef081c4d4..1bb12a0127184 100644 --- a/ACE/protocols/tests/HTBP/Reactor_Tests/client.cpp +++ b/ACE/protocols/tests/HTBP/Reactor_Tests/client.cpp @@ -2,9 +2,11 @@ * client for a reactor based connection establishment test using HTBP */ -#include "ace/Log_Msg.h" #include "ace/Get_Opt.h" +#include "ace/Log_Msg.h" +#include "ace/OS.h" #include "ace/OS_NS_sys_socket.h" +#include "ace/Synch.h" #include "ace/HTBP/HTBP_Session.h" #include "ace/HTBP/HTBP_Stream.h" diff --git a/ACE/protocols/tests/HTBP/Reactor_Tests/server.cpp b/ACE/protocols/tests/HTBP/Reactor_Tests/server.cpp index d2bc3bb661a5c..a24011b9fa40c 100644 --- a/ACE/protocols/tests/HTBP/Reactor_Tests/server.cpp +++ b/ACE/protocols/tests/HTBP/Reactor_Tests/server.cpp @@ -2,21 +2,21 @@ * server for a reactor based connection establishment test using HTBP */ -#include "ace/Log_Msg.h" - -#include "ace/HTBP/HTBP_Session.h" -#include "ace/HTBP/HTBP_Stream.h" -#include "ace/HTBP/HTBP_Addr.h" - -#include "ace/SOCK_Acceptor.h" -#include "ace/SOCK_Stream.h" -#include "ace/Event_Handler.h" -#include "ace/Reactor.h" #include "ace/Get_Opt.h" +#include "ace/Event_Handler.h" +#include "ace/Log_Msg.h" #include "ace/OS_NS_stdio.h" #include "ace/OS_NS_unistd.h" #include "ace/OS_NS_sys_socket.h" #include "ace/os_include/os_netdb.h" +#include "ace/Reactor.h" +#include "ace/SOCK_Acceptor.h" +#include "ace/SOCK_Stream.h" +#include "ace/Synch.h" + +#include "ace/HTBP/HTBP_Session.h" +#include "ace/HTBP/HTBP_Stream.h" +#include "ace/HTBP/HTBP_Addr.h" unsigned port = 8088; const ACE_TCHAR *notifier_file = 0; diff --git a/ACE/protocols/tests/HTBP/Reactor_Tests/test_config.h b/ACE/protocols/tests/HTBP/Reactor_Tests/test_config.h index 3567e4c897f68..b46468ecb4fc9 100644 --- a/ACE/protocols/tests/HTBP/Reactor_Tests/test_config.h +++ b/ACE/protocols/tests/HTBP/Reactor_Tests/test_config.h @@ -31,10 +31,11 @@ // This first #undef protects against command-line definitions. #undef ACE_NDEBUG #include "ace/streams.h" -#include "ace/Singleton.h" -#include "ace/Synch.h" -#include "ace/Log_Msg.h" + #include "ace/ACE.h" +#include "ace/Log_Msg.h" +#include "ace/Singleton.h" +#include "ace/Synch_Traits.h" // The second #undef protects against being reset in a config.h file. #undef ACE_NDEBUG @@ -303,7 +304,7 @@ randomize (int array[], size_t size) } } -typedef ACE_Singleton ace_file_stream; +typedef ACE_Singleton ace_file_stream; #if defined (ACE_HAS_EXPLICIT_STATIC_TEMPLATE_MEMBER_INSTANTIATION) template ACE_Singleton * diff --git a/ACE/protocols/tests/HTBP/Send_Large_Msg/client.cpp b/ACE/protocols/tests/HTBP/Send_Large_Msg/client.cpp index cfe26926333e5..1b94d1fe16654 100644 --- a/ACE/protocols/tests/HTBP/Send_Large_Msg/client.cpp +++ b/ACE/protocols/tests/HTBP/Send_Large_Msg/client.cpp @@ -1,13 +1,14 @@ +#include "ace/Get_Opt.h" +#include "ace/Log_Msg.h" +#include "ace/OS_NS_sys_socket.h" +#include "ace/Synch.h" + #include "ace/HTBP/HTBP_Session.h" #include "ace/HTBP/HTBP_Stream.h" #include "ace/HTBP/HTBP_Addr.h" #include "ace/HTBP/HTBP_ID_Requestor.h" #include "ace/HTBP/HTBP_Environment.h" -#include "ace/Log_Msg.h" -#include "ace/Get_Opt.h" -#include "ace/OS_NS_sys_socket.h" - const ssize_t Send_Size = 4*1024; const size_t Loops = 10; const size_t Total_Size = Send_Size * Loops; diff --git a/ACE/protocols/tests/HTBP/Send_Large_Msg/server.cpp b/ACE/protocols/tests/HTBP/Send_Large_Msg/server.cpp index 2e43f9bfba4d2..7ece62a7e7c3b 100644 --- a/ACE/protocols/tests/HTBP/Send_Large_Msg/server.cpp +++ b/ACE/protocols/tests/HTBP/Send_Large_Msg/server.cpp @@ -1,16 +1,17 @@ -#include "ace/Log_Msg.h" #include "ace/Get_Opt.h" +#include "ace/Log_Msg.h" +#include "ace/OS.h" +#include "ace/OS_NS_stdio.h" +#include "ace/OS_NS_sys_socket.h" +#include "ace/os_include/os_netdb.h" +#include "ace/SOCK_Acceptor.h" +#include "ace/SOCK_Stream.h" +#include "ace/Synch.h" #include "ace/HTBP/HTBP_Session.h" #include "ace/HTBP/HTBP_Stream.h" #include "ace/HTBP/HTBP_Addr.h" -#include "ace/SOCK_Acceptor.h" -#include "ace/SOCK_Stream.h" -#include "ace/OS_NS_stdio.h" -#include "ace/OS_NS_sys_socket.h" -#include "ace/os_include/os_netdb.h" - const size_t Send_Size = 4*1024; const size_t Loops = 10; const size_t Total_Size = Send_Size * Loops; diff --git a/ACE/protocols/tests/HTBP/Send_Recv_Tests/client.cpp b/ACE/protocols/tests/HTBP/Send_Recv_Tests/client.cpp index 23a8d8378367a..5f02b2e0c91ef 100644 --- a/ACE/protocols/tests/HTBP/Send_Recv_Tests/client.cpp +++ b/ACE/protocols/tests/HTBP/Send_Recv_Tests/client.cpp @@ -16,19 +16,20 @@ */ //============================================================================= - -#include "ace/HTBP/HTBP_Stream.h" -#include "ace/HTBP/HTBP_Session.h" -#include "ace/HTBP/HTBP_ID_Requestor.h" -#include "ace/HTBP/HTBP_Environment.h" - +#include "ace/Get_Opt.h" +#include "ace/OS.h" +#include "ace/OS_NS_sys_socket.h" +#include "ace/Synch.h" #include "ace/Thread.h" #include "ace/Thread_Manager.h" #include "ace/SOCK_Connector.h" #include "ace/SOCK_Acceptor.h" #include "ace/SOCK_Stream.h" -#include "ace/Get_Opt.h" -#include "ace/OS_NS_sys_socket.h" + +#include "ace/HTBP/HTBP_Stream.h" +#include "ace/HTBP/HTBP_Session.h" +#include "ace/HTBP/HTBP_ID_Requestor.h" +#include "ace/HTBP/HTBP_Environment.h" // Change to non-zero if test fails static int Test_Result = 0; diff --git a/ACE/protocols/tests/HTBP/Send_Recv_Tests/server.cpp b/ACE/protocols/tests/HTBP/Send_Recv_Tests/server.cpp index 05e2bf4c0690c..7e7a95e859655 100644 --- a/ACE/protocols/tests/HTBP/Send_Recv_Tests/server.cpp +++ b/ACE/protocols/tests/HTBP/Send_Recv_Tests/server.cpp @@ -16,22 +16,23 @@ */ //============================================================================= +#include "ace/Get_Opt.h" +#include "ace/OS.h" +#include "ace/OS_NS_stdio.h" +#include "ace/OS_NS_sys_socket.h" +#include "ace/os_include/os_netdb.h" +#include "ace/SOCK_Connector.h" +#include "ace/SOCK_Acceptor.h" +#include "ace/SOCK_Stream.h" +#include "ace/Synch.h" +#include "ace/Thread.h" +#include "ace/Thread_Manager.h" #include "ace/HTBP/HTBP_Stream.h" #include "ace/HTBP/HTBP_Session.h" #include "ace/HTBP/HTBP_ID_Requestor.h" #include "ace/HTBP/HTBP_Environment.h" -#include "ace/Thread.h" -#include "ace/Thread_Manager.h" -#include "ace/SOCK_Connector.h" -#include "ace/SOCK_Acceptor.h" -#include "ace/SOCK_Stream.h" -#include "ace/Get_Opt.h" -#include "ace/OS_NS_stdio.h" -#include "ace/OS_NS_sys_socket.h" -#include "ace/os_include/os_netdb.h" - // Change to non-zero if test fails static int Test_Result = 0; diff --git a/ACE/protocols/tests/HTBP/ping/client.cpp b/ACE/protocols/tests/HTBP/ping/client.cpp index 6ae5ff57fd2d7..cde6ee3a0cd8b 100644 --- a/ACE/protocols/tests/HTBP/ping/client.cpp +++ b/ACE/protocols/tests/HTBP/ping/client.cpp @@ -5,8 +5,10 @@ #include "ace/ACE.h" #include "ace/Log_Msg.h" #include "ace/Get_Opt.h" +#include "ace/OS.h" #include "ace/OS_NS_sys_socket.h" #include "ace/os_include/os_netdb.h" +#include "ace/Synch.h" #include "ace/HTBP/HTBP_Session.h" #include "ace/HTBP/HTBP_Stream.h" diff --git a/ACE/protocols/tests/HTBP/ping/server.cpp b/ACE/protocols/tests/HTBP/ping/server.cpp index e0a52fba7eb37..f4752a202cad5 100644 --- a/ACE/protocols/tests/HTBP/ping/server.cpp +++ b/ACE/protocols/tests/HTBP/ping/server.cpp @@ -2,19 +2,20 @@ * server for a basic connection establishment test using HTBP */ +#include "ace/Get_Opt.h" #include "ace/Log_Msg.h" +#include "ace/OS.h" +#include "ace/OS_NS_stdio.h" +#include "ace/OS_NS_sys_socket.h" +#include "ace/os_include/os_netdb.h" +#include "ace/SOCK_Acceptor.h" +#include "ace/SOCK_Stream.h" +#include "ace/Synch.h" #include "ace/HTBP/HTBP_Session.h" #include "ace/HTBP/HTBP_Stream.h" #include "ace/HTBP/HTBP_Addr.h" -#include "ace/SOCK_Acceptor.h" -#include "ace/SOCK_Stream.h" -#include "ace/Get_Opt.h" -#include "ace/OS_NS_stdio.h" -#include "ace/OS_NS_sys_socket.h" -#include "ace/os_include/os_netdb.h" - unsigned port = 8088; const ACE_TCHAR *notifier_file = 0; int diff --git a/ACE/tests/Recursive_Condition_Bug_Test.cpp b/ACE/tests/Recursive_Condition_Bug_Test.cpp index 1513b583c5ef3..c2b98b3c92bbf 100644 --- a/ACE/tests/Recursive_Condition_Bug_Test.cpp +++ b/ACE/tests/Recursive_Condition_Bug_Test.cpp @@ -14,14 +14,14 @@ */ //============================================================================= - -#include "test_config.h" +#include "ace/Activation_Queue.h" #include "ace/OS_NS_sys_time.h" +#include "ace/Synch.h" #include "ace/Task_T.h" -#include "ace/Activation_Queue.h" #include "ace/Timer_Heap.h" #include "ace/Timer_Queue_Adapters.h" -#include "ace/Condition_Recursive_Thread_Mutex.h" + +#include "test_config.h" // *NOTE*: explicit template instantiation required here... template class ACE_Condition; diff --git a/ACE/tests/Recursive_Condition_Test.cpp b/ACE/tests/Recursive_Condition_Test.cpp index cfda711b41e1a..221b29cf07ced 100644 --- a/ACE/tests/Recursive_Condition_Test.cpp +++ b/ACE/tests/Recursive_Condition_Test.cpp @@ -11,21 +11,23 @@ */ //============================================================================= - -#include "test_config.h" -#include "ace/OS_NS_unistd.h" -#include "ace/OS_NS_sys_time.h" #include "ace/Event_Handler.h" #include "ace/Log_Msg.h" +#include "ace/OS_NS_sys_time.h" +#include "ace/OS_NS_unistd.h" +#include "ace/Synch.h" #include "ace/Thread_Manager.h" #include "ace/Timer_Heap.h" #include "ace/Timer_Queue_Adapters.h" - +#include "test_config.h" #if defined (ACE_HAS_THREADS) typedef ACE_Thread_Timer_Queue_Adapter Thread_Timer_Queue; +// +//// *NOTE*: explicit template instantiation required here... +//template class ACE_Condition; class Test_Handler : public ACE_Event_Handler { @@ -60,7 +62,8 @@ class Test_Handler : public ACE_Event_Handler // These are for the basic functionality tests. ACE_SYNCH_RECURSIVE_MUTEX mutex_; -ACE_Condition condition_ (mutex_); +//ACE_Condition condition_ (mutex_); +ACE_SYNCH_RECURSIVE_CONDITION condition_ (mutex_); // Test driver sets this to non-zero before spawning and to zero for // waiter. int protected_int = 0; diff --git a/ACE/tests/Refcounted_Auto_Ptr_Test.h b/ACE/tests/Refcounted_Auto_Ptr_Test.h index bc723826f6841..1b59494f7912d 100644 --- a/ACE/tests/Refcounted_Auto_Ptr_Test.h +++ b/ACE/tests/Refcounted_Auto_Ptr_Test.h @@ -15,7 +15,7 @@ #define ACE_TESTS_REFCOUNTED_AUTO_PTR_TEST_H #include "ace/Atomic_Op.h" -#include "ace/Synch.h" +#include "ace/Synch_Traits.h" struct Printer { From 6d660248d356872bcdf80bae2e543710de8a73b2 Mon Sep 17 00:00:00 2001 From: Erik Sohns Date: Thu, 3 Dec 2015 03:40:08 +0100 Subject: [PATCH 07/22] fixed an issue with (exported) template specializations (Win32) (part2) --- ACE/ace/Condition_Recursive_Thread_Mutex.cpp | 12 ------------ ACE/ace/Condition_Recursive_Thread_Mutex.h | 3 --- ACE/ace/Condition_Recursive_Thread_Mutex.inl | 12 ++++++++++++ 3 files changed, 12 insertions(+), 15 deletions(-) diff --git a/ACE/ace/Condition_Recursive_Thread_Mutex.cpp b/ACE/ace/Condition_Recursive_Thread_Mutex.cpp index 4ffe00d194791..763f08154de21 100644 --- a/ACE/ace/Condition_Recursive_Thread_Mutex.cpp +++ b/ACE/ace/Condition_Recursive_Thread_Mutex.cpp @@ -108,18 +108,6 @@ ACE_Condition::wait (ACE_Recursive_Thread_Mutex &mut return result; } -int -ACE_Condition::signal (void) -{ - return ACE_OS::cond_signal (&this->cond_); -} - -int -ACE_Condition::broadcast (void) -{ - return ACE_OS::cond_broadcast (&this->cond_); -} - ACE_END_VERSIONED_NAMESPACE_DECL #endif /* ACE_HAS_THREADS */ diff --git a/ACE/ace/Condition_Recursive_Thread_Mutex.h b/ACE/ace/Condition_Recursive_Thread_Mutex.h index 8061f3b3d636e..bb20c185bb428 100644 --- a/ACE/ace/Condition_Recursive_Thread_Mutex.h +++ b/ACE/ace/Condition_Recursive_Thread_Mutex.h @@ -33,7 +33,6 @@ ACE_BEGIN_VERSIONED_NAMESPACE_DECL class ACE_Time_Value; -#if defined (ACE_BUILD_DLL) /** * @brief ACE_Condition template specialization written using * @a ACE_Recursive_Thread_Mutex. This allows threads to block until @@ -109,9 +108,7 @@ class ACE_Export ACE_Condition ACE_Recursive_Thread_Mutex &mutex_; }; -#else extern template ACE_Export class ACE_Condition; -#endif typedef ACE_Condition ACE_Condition_Recursive_Thread_Mutex; diff --git a/ACE/ace/Condition_Recursive_Thread_Mutex.inl b/ACE/ace/Condition_Recursive_Thread_Mutex.inl index 44e4e09c3a7ba..30895e26f7c05 100644 --- a/ACE/ace/Condition_Recursive_Thread_Mutex.inl +++ b/ACE/ace/Condition_Recursive_Thread_Mutex.inl @@ -13,4 +13,16 @@ ACE_Condition::mutex (void) return this->mutex_; } +ACE_INLINE int +ACE_Condition::signal (void) +{ + return ACE_OS::cond_signal (&this->cond_); +} + +ACE_INLINE int +ACE_Condition::broadcast (void) +{ + return ACE_OS::cond_broadcast (&this->cond_); +} + ACE_END_VERSIONED_NAMESPACE_DECL From b1d83eae3232e4d58125a1388d17f98e3844d08d Mon Sep 17 00:00:00 2001 From: Erik Sohns Date: Thu, 3 Dec 2015 03:40:08 +0100 Subject: [PATCH 08/22] fixed an issue with (exported) template specializations (Win32) (part2) --- ACE/ace/Condition_Recursive_Thread_Mutex.cpp | 12 ------------ ACE/ace/Condition_Recursive_Thread_Mutex.h | 7 +++++-- ACE/ace/Condition_Recursive_Thread_Mutex.inl | 12 ++++++++++++ 3 files changed, 17 insertions(+), 14 deletions(-) diff --git a/ACE/ace/Condition_Recursive_Thread_Mutex.cpp b/ACE/ace/Condition_Recursive_Thread_Mutex.cpp index 4ffe00d194791..763f08154de21 100644 --- a/ACE/ace/Condition_Recursive_Thread_Mutex.cpp +++ b/ACE/ace/Condition_Recursive_Thread_Mutex.cpp @@ -108,18 +108,6 @@ ACE_Condition::wait (ACE_Recursive_Thread_Mutex &mut return result; } -int -ACE_Condition::signal (void) -{ - return ACE_OS::cond_signal (&this->cond_); -} - -int -ACE_Condition::broadcast (void) -{ - return ACE_OS::cond_broadcast (&this->cond_); -} - ACE_END_VERSIONED_NAMESPACE_DECL #endif /* ACE_HAS_THREADS */ diff --git a/ACE/ace/Condition_Recursive_Thread_Mutex.h b/ACE/ace/Condition_Recursive_Thread_Mutex.h index 8061f3b3d636e..19de7846c6405 100644 --- a/ACE/ace/Condition_Recursive_Thread_Mutex.h +++ b/ACE/ace/Condition_Recursive_Thread_Mutex.h @@ -33,7 +33,6 @@ ACE_BEGIN_VERSIONED_NAMESPACE_DECL class ACE_Time_Value; -#if defined (ACE_BUILD_DLL) /** * @brief ACE_Condition template specialization written using * @a ACE_Recursive_Thread_Mutex. This allows threads to block until @@ -109,9 +108,13 @@ class ACE_Export ACE_Condition ACE_Recursive_Thread_Mutex &mutex_; }; +// *NOTE*: prevent implicit instantiations by includees to relieve the linker +#if defined (__GNUG__) +// g++ (5.2.1) does not support attributes on explicit template instantiations +extern template class ACE_Condition; #else extern template ACE_Export class ACE_Condition; -#endif +#endif /* __GNUG__ */ typedef ACE_Condition ACE_Condition_Recursive_Thread_Mutex; diff --git a/ACE/ace/Condition_Recursive_Thread_Mutex.inl b/ACE/ace/Condition_Recursive_Thread_Mutex.inl index 44e4e09c3a7ba..30895e26f7c05 100644 --- a/ACE/ace/Condition_Recursive_Thread_Mutex.inl +++ b/ACE/ace/Condition_Recursive_Thread_Mutex.inl @@ -13,4 +13,16 @@ ACE_Condition::mutex (void) return this->mutex_; } +ACE_INLINE int +ACE_Condition::signal (void) +{ + return ACE_OS::cond_signal (&this->cond_); +} + +ACE_INLINE int +ACE_Condition::broadcast (void) +{ + return ACE_OS::cond_broadcast (&this->cond_); +} + ACE_END_VERSIONED_NAMESPACE_DECL From c717bec70ee3e5337f265c3df995b1b87e7ad32d Mon Sep 17 00:00:00 2001 From: Erik Sohns Date: Thu, 3 Dec 2015 15:03:42 +0100 Subject: [PATCH 09/22] fix potential memory leak when using the Win32 Proactor (part2a) --- ACE/ace/ace.mpc | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/ACE/ace/ace.mpc b/ACE/ace/ace.mpc index 2de100fe757ee..e6ad70787ea3c 100644 --- a/ACE/ace/ace.mpc +++ b/ACE/ace/ace.mpc @@ -3,6 +3,10 @@ project(ACE) : ace_output, acedefaults, install, other, codecs, token, svcconf, avoids = ace_for_tao sharedname = ACE dynamicflags += ACE_BUILD_DLL +// specific(prop:microsoft) { +// compile_flags -= /EHsc +// compile_flags += /EHa +// } Source_Files(ACE_COMPONENTS) { ACE.cpp @@ -382,7 +386,9 @@ project(ACE) : ace_output, acedefaults, install, other, codecs, token, svcconf, Inline_Files { Bound_Ptr.inl + Condition_Recursive_Thread_Mutex.inl Condition_T.inl + Condition_Thread_Mutex.inl Guard_T.inl Handle_Gobbler.inl Intrusive_Auto_Ptr.inl @@ -392,6 +398,7 @@ project(ACE) : ace_output, acedefaults, install, other, codecs, token, svcconf, Reverse_Lock_T.inl TSS_T.inl Time_Value_T.inl + Timer_Queue_Adapters.inl } Header_Files { @@ -404,7 +411,9 @@ project(ACE) : ace_output, acedefaults, install, other, codecs, token, svcconf, Codeset_Symbols.h CORBA_macros.h Codeset_Symbols.h + Condition_Recursive_Thread_Mutex.h Condition_T.h + Condition_Thread_Mutex.h Countdown_Time.h Default_Constants.h Event_Base.h @@ -459,6 +468,7 @@ project(ACE) : ace_output, acedefaults, install, other, codecs, token, svcconf, Timer_Heap.h Timer_List.h Timer_Queue.h + Timer_Queue_Adapters.h Timer_Queuefwd.h Timer_Wheel.h Truncate.h From 733efc7e1b7366858a4d1621cb8bb3fbaeeedaed Mon Sep 17 00:00:00 2001 From: Erik Sohns Date: Thu, 3 Dec 2015 15:22:21 +0100 Subject: [PATCH 10/22] fixed an issue with (exported) template specializations (Win32) (part3) --- ACE/examples/APG/ThreadPools/Futures.cpp | 3 --- ACE/examples/Timer_Queue/Thread_Timer_Queue_Test.cpp | 3 --- ACE/tests/Bug_2772_Regression_Test.cpp | 3 --- 3 files changed, 9 deletions(-) diff --git a/ACE/examples/APG/ThreadPools/Futures.cpp b/ACE/examples/APG/ThreadPools/Futures.cpp index 1ba647922628c..c207c734828b3 100644 --- a/ACE/examples/APG/ThreadPools/Futures.cpp +++ b/ACE/examples/APG/ThreadPools/Futures.cpp @@ -12,9 +12,6 @@ #include "ace/Activation_Queue.h" #include "ace/Condition_T.h" -// *NOTE*: explicit template instantiation required here... -template class ACE_Condition; - #define OUTSTANDING_REQUESTS 20 // Listing 2 code/ch16 diff --git a/ACE/examples/Timer_Queue/Thread_Timer_Queue_Test.cpp b/ACE/examples/Timer_Queue/Thread_Timer_Queue_Test.cpp index d46c084d69017..2a251ffc218b4 100644 --- a/ACE/examples/Timer_Queue/Thread_Timer_Queue_Test.cpp +++ b/ACE/examples/Timer_Queue/Thread_Timer_Queue_Test.cpp @@ -22,9 +22,6 @@ #include "ace/Condition_T.h" #include "ace/Thread_Mutex.h" -// *NOTE*: explicit template instantiation required here... -template class ACE_Condition; - // Administrivia methods... Handler::Handler(const ACE_Time_Value &expiration_time) : expires_ (expiration_time), diff --git a/ACE/tests/Bug_2772_Regression_Test.cpp b/ACE/tests/Bug_2772_Regression_Test.cpp index f2a98427128e3..14c948de6d7a4 100644 --- a/ACE/tests/Bug_2772_Regression_Test.cpp +++ b/ACE/tests/Bug_2772_Regression_Test.cpp @@ -16,9 +16,6 @@ #include "ace/Condition_Recursive_Thread_Mutex.h" #include "ace/Thread.h" -// *NOTE*: explicit template instantiation required here... -template class ACE_Condition; - class ThreadTest { public: From 4155a8ceaba2d24d5cebda3e0703f533d749731c Mon Sep 17 00:00:00 2001 From: Erik Sohns Date: Fri, 4 Dec 2015 18:12:35 +0100 Subject: [PATCH 11/22] fixed an issue with (exported) template specializations (Win32) --- ACE/ace/Condition_Recursive_Thread_Mutex.h | 13 ++++++++----- ACE/ace/config-g++-common.h | 10 +++++++++- ACE/ace/config-win32-msvc-14.h | 4 ++++ 3 files changed, 21 insertions(+), 6 deletions(-) diff --git a/ACE/ace/Condition_Recursive_Thread_Mutex.h b/ACE/ace/Condition_Recursive_Thread_Mutex.h index 19de7846c6405..e3a5a42ef7b02 100644 --- a/ACE/ace/Condition_Recursive_Thread_Mutex.h +++ b/ACE/ace/Condition_Recursive_Thread_Mutex.h @@ -108,13 +108,16 @@ class ACE_Export ACE_Condition ACE_Recursive_Thread_Mutex &mutex_; }; -// *NOTE*: prevent implicit instantiations by includees to relieve the linker -#if defined (__GNUG__) -// g++ (5.2.1) does not support attributes on explicit template instantiations +// prevent implicit instantiations by includers to relieve the linker +#if defined (ACE_HAS_CPP11_EXTERN_TEMPLATES) +// suppress a warning, g++ 5.2.1 does not support attributes on template +// instantiation declarations. *TODO*: this may go back further +# if defined (__GNUG__) && (__GNUC__ == 5 && __GNUC_MINOR__ == 2 && __GNUC_PATCHLEVEL__ == 1) extern template class ACE_Condition; -#else +# else extern template ACE_Export class ACE_Condition; -#endif /* __GNUG__ */ +# endif /* __GNUG__ && (__GNUC__ == 5 && __GNUC_MINOR__ == 2 && __GNUC_PATCHLEVEL__ == 1) */ +#endif /* ACE_HAS_CPP11_EXTERN_TEMPLATES */ typedef ACE_Condition ACE_Condition_Recursive_Thread_Mutex; diff --git a/ACE/ace/config-g++-common.h b/ACE/ace/config-g++-common.h index e024997f42cf4..5a0f16d9b874e 100644 --- a/ACE/ace/config-g++-common.h +++ b/ACE/ace/config-g++-common.h @@ -38,7 +38,15 @@ # if __cplusplus > 201103L # define ACE_HAS_CPP14 # endif -#endif +#endif /* __GNUC__ >= 4.7 */ + +// *NOTE*: this feature may go back further, see e.g.: +// https://gcc.gnu.org/projects/cxx0x.html +#if defined (ACE_HAS_CPP11) +# if (__GNUC__ >= 5 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)) +# define ACE_HAS_CPP11_EXTERN_TEMPLATES +# endif /* __GNUC__ >= 4.3 */ +#endif /* ACE_HAS_CPP11 */ #if (defined (i386) || defined (__i386__)) && !defined (ACE_SIZEOF_LONG_DOUBLE) # define ACE_SIZEOF_LONG_DOUBLE 12 diff --git a/ACE/ace/config-win32-msvc-14.h b/ACE/ace/config-win32-msvc-14.h index e674c97031542..daae26f81bcc6 100644 --- a/ACE/ace/config-win32-msvc-14.h +++ b/ACE/ace/config-win32-msvc-14.h @@ -41,6 +41,10 @@ // Visual Studio 2015 has adequate C++11 support #define ACE_HAS_CPP11 +// *TODO*: this C++11-feature goes back further (at least to MSVC 2010), see: +// https://msdn.microsoft.com/en-us/library/hh567368.aspx#featurelist +#define ACE_HAS_CPP11_EXTERN_TEMPLATES + #define ACE_PUTENV_EQUIVALENT ::_putenv #define ACE_TEMPNAM_EQUIVALENT ::_tempnam #define ACE_STRDUP_EQUIVALENT ::_strdup From 9ca4697dfeabecba5474e117a0dedf86427bdd51 Mon Sep 17 00:00:00 2001 From: Erik Sohns Date: Fri, 4 Dec 2015 18:12:35 +0100 Subject: [PATCH 12/22] fixed an issue with (exported) template specializations (Win32) --- ACE/ace/Condition_Recursive_Thread_Mutex.h | 13 ++++++++----- ACE/ace/config-g++-common.h | 10 +++++++++- ACE/ace/config-win32-msvc-14.h | 4 ++++ ACE/tests/Recursive_Condition_Test.cpp | 3 --- 4 files changed, 21 insertions(+), 9 deletions(-) diff --git a/ACE/ace/Condition_Recursive_Thread_Mutex.h b/ACE/ace/Condition_Recursive_Thread_Mutex.h index 19de7846c6405..e3a5a42ef7b02 100644 --- a/ACE/ace/Condition_Recursive_Thread_Mutex.h +++ b/ACE/ace/Condition_Recursive_Thread_Mutex.h @@ -108,13 +108,16 @@ class ACE_Export ACE_Condition ACE_Recursive_Thread_Mutex &mutex_; }; -// *NOTE*: prevent implicit instantiations by includees to relieve the linker -#if defined (__GNUG__) -// g++ (5.2.1) does not support attributes on explicit template instantiations +// prevent implicit instantiations by includers to relieve the linker +#if defined (ACE_HAS_CPP11_EXTERN_TEMPLATES) +// suppress a warning, g++ 5.2.1 does not support attributes on template +// instantiation declarations. *TODO*: this may go back further +# if defined (__GNUG__) && (__GNUC__ == 5 && __GNUC_MINOR__ == 2 && __GNUC_PATCHLEVEL__ == 1) extern template class ACE_Condition; -#else +# else extern template ACE_Export class ACE_Condition; -#endif /* __GNUG__ */ +# endif /* __GNUG__ && (__GNUC__ == 5 && __GNUC_MINOR__ == 2 && __GNUC_PATCHLEVEL__ == 1) */ +#endif /* ACE_HAS_CPP11_EXTERN_TEMPLATES */ typedef ACE_Condition ACE_Condition_Recursive_Thread_Mutex; diff --git a/ACE/ace/config-g++-common.h b/ACE/ace/config-g++-common.h index e024997f42cf4..5a0f16d9b874e 100644 --- a/ACE/ace/config-g++-common.h +++ b/ACE/ace/config-g++-common.h @@ -38,7 +38,15 @@ # if __cplusplus > 201103L # define ACE_HAS_CPP14 # endif -#endif +#endif /* __GNUC__ >= 4.7 */ + +// *NOTE*: this feature may go back further, see e.g.: +// https://gcc.gnu.org/projects/cxx0x.html +#if defined (ACE_HAS_CPP11) +# if (__GNUC__ >= 5 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)) +# define ACE_HAS_CPP11_EXTERN_TEMPLATES +# endif /* __GNUC__ >= 4.3 */ +#endif /* ACE_HAS_CPP11 */ #if (defined (i386) || defined (__i386__)) && !defined (ACE_SIZEOF_LONG_DOUBLE) # define ACE_SIZEOF_LONG_DOUBLE 12 diff --git a/ACE/ace/config-win32-msvc-14.h b/ACE/ace/config-win32-msvc-14.h index e674c97031542..daae26f81bcc6 100644 --- a/ACE/ace/config-win32-msvc-14.h +++ b/ACE/ace/config-win32-msvc-14.h @@ -41,6 +41,10 @@ // Visual Studio 2015 has adequate C++11 support #define ACE_HAS_CPP11 +// *TODO*: this C++11-feature goes back further (at least to MSVC 2010), see: +// https://msdn.microsoft.com/en-us/library/hh567368.aspx#featurelist +#define ACE_HAS_CPP11_EXTERN_TEMPLATES + #define ACE_PUTENV_EQUIVALENT ::_putenv #define ACE_TEMPNAM_EQUIVALENT ::_tempnam #define ACE_STRDUP_EQUIVALENT ::_strdup diff --git a/ACE/tests/Recursive_Condition_Test.cpp b/ACE/tests/Recursive_Condition_Test.cpp index 221b29cf07ced..394100cd0c619 100644 --- a/ACE/tests/Recursive_Condition_Test.cpp +++ b/ACE/tests/Recursive_Condition_Test.cpp @@ -25,9 +25,6 @@ #if defined (ACE_HAS_THREADS) typedef ACE_Thread_Timer_Queue_Adapter Thread_Timer_Queue; -// -//// *NOTE*: explicit template instantiation required here... -//template class ACE_Condition; class Test_Handler : public ACE_Event_Handler { From 12805745e7b8e95c1f2991433c9c836fe9591a6c Mon Sep 17 00:00:00 2001 From: Erik Sohns Date: Fri, 4 Dec 2015 18:34:45 +0100 Subject: [PATCH 13/22] fix potential memory leak when using the Win32 Proactor (part2a) --- ACE/ace/ace.mpc | 4 ---- 1 file changed, 4 deletions(-) diff --git a/ACE/ace/ace.mpc b/ACE/ace/ace.mpc index e6ad70787ea3c..78cf996f52f73 100644 --- a/ACE/ace/ace.mpc +++ b/ACE/ace/ace.mpc @@ -3,10 +3,6 @@ project(ACE) : ace_output, acedefaults, install, other, codecs, token, svcconf, avoids = ace_for_tao sharedname = ACE dynamicflags += ACE_BUILD_DLL -// specific(prop:microsoft) { -// compile_flags -= /EHsc -// compile_flags += /EHa -// } Source_Files(ACE_COMPONENTS) { ACE.cpp From b695f270c103b3945fb9466401d10174944da8d5 Mon Sep 17 00:00:00 2001 From: Erik Sohns Date: Fri, 4 Dec 2015 18:53:58 +0100 Subject: [PATCH 14/22] fixed an issue with (exported) template specializations (Win32) --- ACE/ace/Condition_Recursive_Thread_Mutex.h | 6 ++---- ACE/ace/config-g++-common.h | 7 +++++++ 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/ACE/ace/Condition_Recursive_Thread_Mutex.h b/ACE/ace/Condition_Recursive_Thread_Mutex.h index e3a5a42ef7b02..8d0b277511ac9 100644 --- a/ACE/ace/Condition_Recursive_Thread_Mutex.h +++ b/ACE/ace/Condition_Recursive_Thread_Mutex.h @@ -110,13 +110,11 @@ class ACE_Export ACE_Condition }; // prevent implicit instantiations by includers to relieve the linker #if defined (ACE_HAS_CPP11_EXTERN_TEMPLATES) -// suppress a warning, g++ 5.2.1 does not support attributes on template -// instantiation declarations. *TODO*: this may go back further -# if defined (__GNUG__) && (__GNUC__ == 5 && __GNUC_MINOR__ == 2 && __GNUC_PATCHLEVEL__ == 1) +# if defined (ACE_LACKS_CPP11_EXTERN_TEMPLATE_ATTRIBUTES) extern template class ACE_Condition; # else extern template ACE_Export class ACE_Condition; -# endif /* __GNUG__ && (__GNUC__ == 5 && __GNUC_MINOR__ == 2 && __GNUC_PATCHLEVEL__ == 1) */ +# endif /* ACE_LACKS_CPP11_EXTERN_TEMPLATE_ATTRIBUTES */ #endif /* ACE_HAS_CPP11_EXTERN_TEMPLATES */ typedef ACE_Condition ACE_Condition_Recursive_Thread_Mutex; diff --git a/ACE/ace/config-g++-common.h b/ACE/ace/config-g++-common.h index 5a0f16d9b874e..48774773f29fd 100644 --- a/ACE/ace/config-g++-common.h +++ b/ACE/ace/config-g++-common.h @@ -46,6 +46,13 @@ # if (__GNUC__ >= 5 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)) # define ACE_HAS_CPP11_EXTERN_TEMPLATES # endif /* __GNUC__ >= 4.3 */ + +// *NOTE*: suppress a warning, g++ 5.2.1 does not support attributes on template +// instantiation declarations +// *TODO*: this probably goes back further than 5.2 +# if (__GNUC__ >= 5 || (__GNUC__ == 5 && __GNUC_MINOR__ >= 2)) +# define ACE_LACKS_CPP11_EXTERN_TEMPLATE_ATTRIBUTES +# endif /* __GNUC__ >= 5.2 */ #endif /* ACE_HAS_CPP11 */ #if (defined (i386) || defined (__i386__)) && !defined (ACE_SIZEOF_LONG_DOUBLE) From 39aeb7f5722b0a02318a78973a2f1ab9aa9ef405 Mon Sep 17 00:00:00 2001 From: Erik Sohns Date: Fri, 4 Dec 2015 18:54:23 +0100 Subject: [PATCH 15/22] fixed an issue with (exported) template specializations (Win32) --- ACE/tests/Recursive_Condition_Test.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/ACE/tests/Recursive_Condition_Test.cpp b/ACE/tests/Recursive_Condition_Test.cpp index 394100cd0c619..da75b00097713 100644 --- a/ACE/tests/Recursive_Condition_Test.cpp +++ b/ACE/tests/Recursive_Condition_Test.cpp @@ -59,7 +59,6 @@ class Test_Handler : public ACE_Event_Handler // These are for the basic functionality tests. ACE_SYNCH_RECURSIVE_MUTEX mutex_; -//ACE_Condition condition_ (mutex_); ACE_SYNCH_RECURSIVE_CONDITION condition_ (mutex_); // Test driver sets this to non-zero before spawning and to zero for // waiter. From 5a757dde38a30de454f1b5c3db3f1873de20c098 Mon Sep 17 00:00:00 2001 From: Erik Sohns Date: Fri, 4 Dec 2015 19:14:15 +0100 Subject: [PATCH 16/22] fixed an issue with (exported) template specializations (Win32) --- ACE/ace/config-g++-common.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ACE/ace/config-g++-common.h b/ACE/ace/config-g++-common.h index 48774773f29fd..923f8d6c064ee 100644 --- a/ACE/ace/config-g++-common.h +++ b/ACE/ace/config-g++-common.h @@ -50,7 +50,7 @@ // *NOTE*: suppress a warning, g++ 5.2.1 does not support attributes on template // instantiation declarations // *TODO*: this probably goes back further than 5.2 -# if (__GNUC__ >= 5 || (__GNUC__ == 5 && __GNUC_MINOR__ >= 2)) +# if (__GNUC__ >= 6 || (__GNUC__ == 5 && __GNUC_MINOR__ >= 2)) # define ACE_LACKS_CPP11_EXTERN_TEMPLATE_ATTRIBUTES # endif /* __GNUC__ >= 5.2 */ #endif /* ACE_HAS_CPP11 */ From a255354d170aaa6d0d9b91c3ee568b556b26e4aa Mon Sep 17 00:00:00 2001 From: Erik Sohns Date: Fri, 4 Dec 2015 19:22:29 +0100 Subject: [PATCH 17/22] repaired include strategy for ace/Synch.h (prerequisite to solving template instantiation issues on Win32) (update) this addresses complaints by the integration build system (#include ace/OS.h) --- ACE/protocols/tests/HTBP/Reactor_Tests/client.cpp | 1 - ACE/protocols/tests/HTBP/Send_Large_Msg/server.cpp | 1 - ACE/protocols/tests/HTBP/Send_Recv_Tests/client.cpp | 1 - ACE/protocols/tests/HTBP/Send_Recv_Tests/server.cpp | 1 - ACE/protocols/tests/HTBP/ping/client.cpp | 1 - ACE/protocols/tests/HTBP/ping/server.cpp | 1 - 6 files changed, 6 deletions(-) diff --git a/ACE/protocols/tests/HTBP/Reactor_Tests/client.cpp b/ACE/protocols/tests/HTBP/Reactor_Tests/client.cpp index 1bb12a0127184..d4e8cd6b6716a 100644 --- a/ACE/protocols/tests/HTBP/Reactor_Tests/client.cpp +++ b/ACE/protocols/tests/HTBP/Reactor_Tests/client.cpp @@ -4,7 +4,6 @@ #include "ace/Get_Opt.h" #include "ace/Log_Msg.h" -#include "ace/OS.h" #include "ace/OS_NS_sys_socket.h" #include "ace/Synch.h" diff --git a/ACE/protocols/tests/HTBP/Send_Large_Msg/server.cpp b/ACE/protocols/tests/HTBP/Send_Large_Msg/server.cpp index 7ece62a7e7c3b..d228e1dd3cc30 100644 --- a/ACE/protocols/tests/HTBP/Send_Large_Msg/server.cpp +++ b/ACE/protocols/tests/HTBP/Send_Large_Msg/server.cpp @@ -1,6 +1,5 @@ #include "ace/Get_Opt.h" #include "ace/Log_Msg.h" -#include "ace/OS.h" #include "ace/OS_NS_stdio.h" #include "ace/OS_NS_sys_socket.h" #include "ace/os_include/os_netdb.h" diff --git a/ACE/protocols/tests/HTBP/Send_Recv_Tests/client.cpp b/ACE/protocols/tests/HTBP/Send_Recv_Tests/client.cpp index 5f02b2e0c91ef..f343a5554d9d5 100644 --- a/ACE/protocols/tests/HTBP/Send_Recv_Tests/client.cpp +++ b/ACE/protocols/tests/HTBP/Send_Recv_Tests/client.cpp @@ -17,7 +17,6 @@ //============================================================================= #include "ace/Get_Opt.h" -#include "ace/OS.h" #include "ace/OS_NS_sys_socket.h" #include "ace/Synch.h" #include "ace/Thread.h" diff --git a/ACE/protocols/tests/HTBP/Send_Recv_Tests/server.cpp b/ACE/protocols/tests/HTBP/Send_Recv_Tests/server.cpp index 7e7a95e859655..0e4b115faf0ac 100644 --- a/ACE/protocols/tests/HTBP/Send_Recv_Tests/server.cpp +++ b/ACE/protocols/tests/HTBP/Send_Recv_Tests/server.cpp @@ -17,7 +17,6 @@ //============================================================================= #include "ace/Get_Opt.h" -#include "ace/OS.h" #include "ace/OS_NS_stdio.h" #include "ace/OS_NS_sys_socket.h" #include "ace/os_include/os_netdb.h" diff --git a/ACE/protocols/tests/HTBP/ping/client.cpp b/ACE/protocols/tests/HTBP/ping/client.cpp index cde6ee3a0cd8b..881acf6491707 100644 --- a/ACE/protocols/tests/HTBP/ping/client.cpp +++ b/ACE/protocols/tests/HTBP/ping/client.cpp @@ -5,7 +5,6 @@ #include "ace/ACE.h" #include "ace/Log_Msg.h" #include "ace/Get_Opt.h" -#include "ace/OS.h" #include "ace/OS_NS_sys_socket.h" #include "ace/os_include/os_netdb.h" #include "ace/Synch.h" diff --git a/ACE/protocols/tests/HTBP/ping/server.cpp b/ACE/protocols/tests/HTBP/ping/server.cpp index f4752a202cad5..0fb22f90765bd 100644 --- a/ACE/protocols/tests/HTBP/ping/server.cpp +++ b/ACE/protocols/tests/HTBP/ping/server.cpp @@ -4,7 +4,6 @@ #include "ace/Get_Opt.h" #include "ace/Log_Msg.h" -#include "ace/OS.h" #include "ace/OS_NS_stdio.h" #include "ace/OS_NS_sys_socket.h" #include "ace/os_include/os_netdb.h" From dee50e84e5e3d18f727c0257b85c37fb68e73e0e Mon Sep 17 00:00:00 2001 From: Erik Sohns Date: Sun, 13 Dec 2015 16:54:59 +0100 Subject: [PATCH 18/22] added support for CancelIoEx() (Win32) (update passes travis-ci build) --- ACE/ace/WIN32_Asynch_IO.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ACE/ace/WIN32_Asynch_IO.cpp b/ACE/ace/WIN32_Asynch_IO.cpp index 7f3d9d6fbc420..1d42267843d10 100644 --- a/ACE/ace/WIN32_Asynch_IO.cpp +++ b/ACE/ace/WIN32_Asynch_IO.cpp @@ -179,7 +179,7 @@ ACE_WIN32_Asynch_Operation::cancel (void) int const result = (int) ::CancelIo (this->handle_); #else int const result = (int) ::CancelIoEx (this->handle_, - NULL); + 0); #endif /* _WIN32_WINNT < 0x0600 */ if (result == 0) From 219ae584c43856583338728bbe27a045191f70ae Mon Sep 17 00:00:00 2001 From: Erik Sohns Date: Mon, 30 May 2016 00:18:45 +0200 Subject: [PATCH 19/22] reuse current timestamp to compute wait delay --- ACE/ace/Timer_Queue_Adapters.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ACE/ace/Timer_Queue_Adapters.cpp b/ACE/ace/Timer_Queue_Adapters.cpp index b2ccf1a21682b..a56bc9a21e5e6 100644 --- a/ACE/ace/Timer_Queue_Adapters.cpp +++ b/ACE/ace/Timer_Queue_Adapters.cpp @@ -276,7 +276,7 @@ ACE_Thread_Timer_Queue_Adapter::svc (void) { // The earliest time on the Timer_Queue lies in future; // convert the tv to an absolute time. - ACE_Time_Value const tv = this->timer_queue_->gettimeofday () + (tv_earl - tv_curr); + ACE_Time_Value const tv = tv_curr + (tv_earl - tv_curr); // ACELIB_DEBUG ((LM_DEBUG, ACE_TEXT ("waiting until %u.%3.3u secs\n"), // tv.sec(), tv.msec())); this->condition_.wait (&tv); From 8dbd7242889f83bd094ead021940911eb121b8aa Mon Sep 17 00:00:00 2001 From: Erik Sohns Date: Sun, 23 Oct 2016 19:51:36 +0200 Subject: [PATCH 20/22] repaired integration build failure --- ACE/protocols/ace/HTBP/HTBP_Inside_Squid_Filter.cpp | 2 +- ACE/protocols/ace/HTBP/HTBP_Session.cpp | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/ACE/protocols/ace/HTBP/HTBP_Inside_Squid_Filter.cpp b/ACE/protocols/ace/HTBP/HTBP_Inside_Squid_Filter.cpp index 01ea2f32e60bd..36493c0b4395e 100644 --- a/ACE/protocols/ace/HTBP/HTBP_Inside_Squid_Filter.cpp +++ b/ACE/protocols/ace/HTBP/HTBP_Inside_Squid_Filter.cpp @@ -2,6 +2,7 @@ #include "ace/Auto_Ptr.h" #include "ace/Log_Msg.h" #include "ace/OS_NS_stdio.h" +#include "ace/Synch.h" #include "HTBP_Session.h" #include "HTBP_Inside_Squid_Filter.h" @@ -11,7 +12,6 @@ #include "ace/Log_Msg.h" #include "ace/OS_NS_stdio.h" -#include "ace/Synch.h" #include "HTBP_Session.h" diff --git a/ACE/protocols/ace/HTBP/HTBP_Session.cpp b/ACE/protocols/ace/HTBP/HTBP_Session.cpp index 1f5109e835cb8..b62a692342423 100644 --- a/ACE/protocols/ace/HTBP/HTBP_Session.cpp +++ b/ACE/protocols/ace/HTBP/HTBP_Session.cpp @@ -5,10 +5,11 @@ #include "HTBP_Session.inl" #endif -#include "ace/Event_Handler.h" -#include "ace/Log_Msg.h" #include "ace/os_include/netinet/os_tcp.h" #include "ace/Auto_Ptr.h" +#include "ace/Event_Handler.h" +#include "ace/Log_Msg.h" +#include "ace/SOCK_Connector.h" #include "HTBP_Filter.h" #include "HTBP_ID_Requestor.h" From 53bbf4b8808b40cd77679cac48317fcecbd42fa3 Mon Sep 17 00:00:00 2001 From: Erik Sohns Date: Mon, 24 Oct 2016 18:23:43 +0200 Subject: [PATCH 21/22] removed now-obsolete template instantiation left over from an earlier commit --- ACE/tests/Recursive_Condition_Bug_Test.cpp | 3 --- 1 file changed, 3 deletions(-) diff --git a/ACE/tests/Recursive_Condition_Bug_Test.cpp b/ACE/tests/Recursive_Condition_Bug_Test.cpp index c2b98b3c92bbf..bbfaa98a0fbdc 100644 --- a/ACE/tests/Recursive_Condition_Bug_Test.cpp +++ b/ACE/tests/Recursive_Condition_Bug_Test.cpp @@ -23,9 +23,6 @@ #include "test_config.h" -// *NOTE*: explicit template instantiation required here... -template class ACE_Condition; - #if defined (ACE_HAS_THREADS) // Number of iterations for the performance tests. From 4bb4047e520cd551b7d9bf0a1079103b68e3bf7d Mon Sep 17 00:00:00 2001 From: Erik Sohns Date: Sun, 30 Oct 2016 22:18:29 +0100 Subject: [PATCH 22/22] updated NEWS --- ACE/NEWS | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/ACE/NEWS b/ACE/NEWS index e3338ac417ea3..343b5df37dfb4 100644 --- a/ACE/NEWS +++ b/ACE/NEWS @@ -1,6 +1,28 @@ USER VISIBLE CHANGES BETWEEN ACE-6.4.1 and ACE-6.4.2 ==================================================== +. Added support for getpwnam_r on Solaris 11 + +. ACE_OSTREAM_TYPE uses the std namespace where applicable + +. ACE_WIN32_Asynch_Operation::cancel() uses CancelIOEx on Windows Vista and + above + +. Bugfix of exported template specializations on Win32 platforms + (specifically, ACE_Condition_Recursive_Thread_Mutex) + +. Fixed potential memory leak when using the ACE_WIN32_Proactor + +. Header sanitizations (specifically, ace/Synch.h) + +. Fixed a race condition in ACE_Thread_Manager::task_wait() on Win32 + +. A (major) cleanup of timer queue code + +. Repaired the ACE_Timer_Hash class. This class code was unused for a while + and essentially broken due to bit-rot. It is now another (meta-)implementation + that can be used stand-alone, or with the other timer queue implementations + USER VISIBLE CHANGES BETWEEN ACE-6.4.0 and ACE-6.4.1 ====================================================