Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

some (bundled) minor changes (take 2) #176

Merged
merged 26 commits into from
Oct 31, 2016
Merged
Show file tree
Hide file tree
Changes from 14 commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
3bff6f8
improved solaris 11 support
Dec 1, 2015
6cec721
fix problem with std io when using ACE_OSTREAM_TYPE
Dec 1, 2015
502c6fc
added support for CancelIoEx() (Win32)
Dec 1, 2015
aeb68c0
fixed an issue with (exported) template specializations (Win32)
Dec 2, 2015
de13b79
fix potential memory leak when using the Win32 Proactor (part1)
Dec 2, 2015
7acfc9e
repaired include strategy for ace/Synch.h (prerequisite to solving te…
Dec 3, 2015
6d66024
fixed an issue with (exported) template specializations (Win32) (part2)
Dec 3, 2015
b1d83ea
fixed an issue with (exported) template specializations (Win32) (part2)
Dec 3, 2015
6dba799
Merge branch 'master' of github.com:esohns/ATCD
Dec 3, 2015
c717bec
fix potential memory leak when using the Win32 Proactor (part2a)
Dec 3, 2015
733efc7
fixed an issue with (exported) template specializations (Win32) (part3)
Dec 3, 2015
4155a8c
fixed an issue with (exported) template specializations (Win32)
Dec 4, 2015
9ca4697
fixed an issue with (exported) template specializations (Win32)
Dec 4, 2015
2609c79
Merge branch 'master' of github.com:esohns/ATCD
Dec 4, 2015
1280574
fix potential memory leak when using the Win32 Proactor (part2a)
Dec 4, 2015
b695f27
fixed an issue with (exported) template specializations (Win32)
Dec 4, 2015
39aeb7f
fixed an issue with (exported) template specializations (Win32)
Dec 4, 2015
5a757dd
fixed an issue with (exported) template specializations (Win32)
Dec 4, 2015
a255354
repaired include strategy for ace/Synch.h (prerequisite to solving te…
Dec 4, 2015
dee50e8
added support for CancelIoEx() (Win32) (update passes travis-ci build)
Dec 13, 2015
219ae58
reuse current timestamp to compute wait delay
May 29, 2016
7ad5360
Merge branch 'master' of https://github.com/DOCGroup/ACE_TAO
Jul 14, 2016
d5fbc0d
Merge branch 'master' of https://github.com/DOCGroup/ACE_TAO
Oct 23, 2016
8dbd724
repaired integration build failure
Oct 23, 2016
53bbf4b
removed now-obsolete template instantiation left over from an earlier…
Oct 24, 2016
4bb4047
updated NEWS
Oct 30, 2016
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 10 additions & 28 deletions ACE/ace/Condition_Recursive_Thread_Mutex.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<ACE_Recursive_Thread_Mutex>::remove (void)
{
return ACE_OS::cond_destroy (&this->cond_);
}
ACE_ALLOC_HOOK_DEFINE (ACE_Condition<ACE_Recursive_Thread_Mutex>)

void
ACE_Condition<ACE_Recursive_Thread_Mutex>::dump (void) const
Expand All @@ -37,11 +37,6 @@ ACE_Condition<ACE_Recursive_Thread_Mutex>::dump (void) const
#endif /* ACE_HAS_DUMP */
}

ACE_Condition<ACE_Recursive_Thread_Mutex>::~ACE_Condition (void)
{
this->remove ();
}

ACE_Condition<ACE_Recursive_Thread_Mutex>::ACE_Condition (ACE_Recursive_Thread_Mutex &m)
: mutex_ (m)
{
Expand All @@ -60,6 +55,11 @@ ACE_Condition<ACE_Recursive_Thread_Mutex>::ACE_Condition (ACE_Recursive_Thread_M
ACE_TEXT ("ACE_Condition<ACE_Recursive_Thread_Mutex>::ACE_Condition<ACE_Recursive_Thread_Mutex>")));
}

ACE_Condition<ACE_Recursive_Thread_Mutex>::~ACE_Condition (void)
{
this->remove ();
}

int
ACE_Condition<ACE_Recursive_Thread_Mutex>::wait (const ACE_Time_Value *abstime)
{
Expand Down Expand Up @@ -108,24 +108,6 @@ ACE_Condition<ACE_Recursive_Thread_Mutex>::wait (ACE_Recursive_Thread_Mutex &mut
return result;
}

int
ACE_Condition<ACE_Recursive_Thread_Mutex>::signal (void)
{
return ACE_OS::cond_signal (&this->cond_);
}

int
ACE_Condition<ACE_Recursive_Thread_Mutex>::broadcast (void)
{
return ACE_OS::cond_broadcast (&this->cond_);
}

ACE_Recursive_Thread_Mutex &
ACE_Condition<ACE_Recursive_Thread_Mutex>::mutex (void)
{
return this->mutex_;
}

ACE_END_VERSIONED_NAMESPACE_DECL

#endif /* ACE_HAS_THREADS */
21 changes: 21 additions & 0 deletions ACE/ace/Condition_Recursive_Thread_Mutex.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,16 @@
#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;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this one needed?

Copy link
Contributor Author

@esohns esohns Oct 30, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is a 'forward declaration'; the header does not #include ace/Time_Value.h, even though it is referencing ACE_Time_Value*. Depending on what the other #includes pull in, this may not be needed (but the header is more consistent this way). As I was changing the header, I cleaned it up a little bit.


/**
* @brief ACE_Condition template specialization written using
* @a ACE_Recursive_Thread_Mutex. This allows threads to block until
Expand Down Expand Up @@ -86,6 +90,9 @@ class ACE_Export ACE_Condition<ACE_Recursive_Thread_Mutex>
/// Dump the state of an object.
void dump (void) const;

/// Declare the dynamic allocation hooks.
ACE_ALLOC_HOOK_DECLARE;

private:

// = Prevent assignment and copying.
Expand All @@ -101,11 +108,25 @@ class ACE_Export ACE_Condition<ACE_Recursive_Thread_Mutex>
ACE_Recursive_Thread_Mutex &mutex_;

};
// 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)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also use a new define for this, that makes it easier when this is needed in more places and for example gcc 5.2.2 has the same issue

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

agreed, please see commit b695f27

extern template class ACE_Condition<ACE_Recursive_Thread_Mutex>;
# else
extern template ACE_Export class ACE_Condition<ACE_Recursive_Thread_Mutex>;
# endif /* __GNUG__ && (__GNUC__ == 5 && __GNUC_MINOR__ == 2 && __GNUC_PATCHLEVEL__ == 1) */
#endif /* ACE_HAS_CPP11_EXTERN_TEMPLATES */

typedef ACE_Condition<ACE_Recursive_Thread_Mutex> 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"
Expand Down
28 changes: 28 additions & 0 deletions ACE/ace/Condition_Recursive_Thread_Mutex.inl
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
// -*- C++ -*-
ACE_BEGIN_VERSIONED_NAMESPACE_DECL

ACE_INLINE int
ACE_Condition<ACE_Recursive_Thread_Mutex>::remove (void)
{
return ACE_OS::cond_destroy (&this->cond_);
}

ACE_INLINE ACE_Recursive_Thread_Mutex &
ACE_Condition<ACE_Recursive_Thread_Mutex>::mutex (void)
{
return this->mutex_;
}

ACE_INLINE int
ACE_Condition<ACE_Recursive_Thread_Mutex>::signal (void)
{
return ACE_OS::cond_signal (&this->cond_);
}

ACE_INLINE int
ACE_Condition<ACE_Recursive_Thread_Mutex>::broadcast (void)
{
return ACE_OS::cond_broadcast (&this->cond_);
}

ACE_END_VERSIONED_NAMESPACE_DECL
2 changes: 0 additions & 2 deletions ACE/ace/Future.h
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
8 changes: 8 additions & 0 deletions ACE/ace/OS_NS_pwd.inl
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down
4 changes: 4 additions & 0 deletions ACE/ace/Synch.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion ACE/ace/Timer_Queue_Adapters.h
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
5 changes: 5 additions & 0 deletions ACE/ace/WIN32_Asynch_IO.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
6 changes: 6 additions & 0 deletions ACE/ace/WIN32_Proactor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
10 changes: 10 additions & 0 deletions ACE/ace/ace.mpc
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why comment this out?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

because it doesn't work yet. Haven't figured out why, can you test and advise ?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please remove it from the merge then, we want to keep a clean code base

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, reverted in commit 1280574

// compile_flags -= /EHsc
// compile_flags += /EHa
// }

Source_Files(ACE_COMPONENTS) {
ACE.cpp
Expand Down Expand Up @@ -382,7 +386,9 @@ project(ACE) : ace_output, acedefaults, install, other, codecs, token, svcconf,

Inline_Files {
Bound_Ptr.inl
Condition_Recursive_Thread_Mutex.inl
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably similar changes have to be made in ace_for_tao.mpc

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, I noticed there are other files missing in the lists.

I don't really want to repair the ACE project configurations at this time, partly because I don't yet understand very much about MPC

Condition_T.inl
Condition_Thread_Mutex.inl
Guard_T.inl
Handle_Gobbler.inl
Intrusive_Auto_Ptr.inl
Expand All @@ -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 {
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down
10 changes: 9 additions & 1 deletion ACE/ace/config-g++-common.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 4 additions & 0 deletions ACE/ace/config-macros.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 */

Expand Down
3 changes: 3 additions & 0 deletions ACE/ace/config-sunos5.11.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
4 changes: 4 additions & 0 deletions ACE/ace/config-win32-msvc-14.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions ACE/apps/JAWS3/http/HTTP_Service_Handler.h
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down
4 changes: 2 additions & 2 deletions ACE/apps/JAWS3/jaws3/Cached_Allocator_T.h
Original file line number Diff line number Diff line change
Expand Up @@ -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) \
Expand Down
5 changes: 3 additions & 2 deletions ACE/apps/JAWS3/jaws3/Config_File.cpp
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion ACE/apps/JAWS3/jaws3/Datagram.h
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion ACE/apps/JAWS3/jaws3/Options.h
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion ACE/apps/JAWS3/jaws3/Signal_Task.h
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down
2 changes: 2 additions & 0 deletions ACE/apps/JAWS3/jaws3/Symbol_Table.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
Loading