[10643] Update the ACE part we use to 5.8.2

Signed-off-by: Neo2003 <Neo.2003@Hotmail.fr>
This commit is contained in:
Neo2003 2010-10-25 20:36:51 +02:00
parent 8f71d95c0d
commit 23c920ca4b
739 changed files with 22031 additions and 40373 deletions

View file

@ -1,4 +1,4 @@
// $Id: Object_Manager.cpp 81450 2008-04-25 21:24:33Z mitza $
// $Id: Object_Manager.cpp 91286 2010-08-05 09:04:31Z johnnyw $
#include "ace/Object_Manager.h"
#if !defined (ACE_LACKS_ACE_TOKEN)
@ -30,8 +30,13 @@
#include "ace/Null_Mutex.h"
#include "ace/Mutex.h"
#include "ace/RW_Thread_Mutex.h"
#if defined (ACE_DISABLE_WIN32_ERROR_WINDOWS) && \
defined (ACE_WIN32) && !defined (ACE_HAS_WINCE) \
&& (_MSC_VER >= 1400) // VC++ 8.0 and above.
#include "ace/OS_NS_stdlib.h"
#endif // ACE_DISABLE_WIN32_ERROR_WINDOWS && ACE_WIN32 && !ACE_HAS_WINCE && (_MSC_VER >= 1400)
ACE_RCSID(ace, Object_Manager, "$Id: Object_Manager.cpp 81450 2008-04-25 21:24:33Z mitza $")
#if ! defined (ACE_APPLICATION_PREALLOCATED_OBJECT_DEFINITIONS)
# define ACE_APPLICATION_PREALLOCATED_OBJECT_DEFINITIONS
@ -51,6 +56,18 @@ ACE_RCSID(ace, Object_Manager, "$Id: Object_Manager.cpp 81450 2008-04-25 21:24:3
ACE_BEGIN_VERSIONED_NAMESPACE_DECL
// Note the following fix was derived from that proposed by Jochen Kalmbach
// http://blog.kalmbachnet.de/?postid=75
#if defined (ACE_DISABLE_WIN32_ERROR_WINDOWS) && \
defined (ACE_WIN32) && !defined (ACE_HAS_WINCE) && \
(_MSC_VER >= 1400) && defined (_M_IX86)
LPTOP_LEVEL_EXCEPTION_FILTER WINAPI ACEdisableSetUnhandledExceptionFilter (
LPTOP_LEVEL_EXCEPTION_FILTER lpTopLevelExceptionFilter)
{
return 0;
}
#endif // ACE_DISABLE_WIN32_ERROR_WINDOWS && ACE_WIN32 && !ACE_HAS_WINCE && (_MSC_VER >= 1400) && _M_IX86
// Singleton pointer.
ACE_Object_Manager *ACE_Object_Manager::instance_ = 0;
@ -257,6 +274,53 @@ ACE_Object_Manager::init (void)
// And this will catch all unhandled exceptions.
SetUnhandledExceptionFilter (&ACE_UnhandledExceptionFilter);
# if (_MSC_VER >= 1400) // VC++ 8.0 and above.
// And this will stop the abort system call from being treated as a crash
_set_abort_behavior( 0, _CALL_REPORTFAULT);
// Note the following fix was derived from that proposed by Jochen Kalmbach
// http://blog.kalmbachnet.de/?postid=75
// See also:
// http://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=101337
//
// Starting with VC8 (VS2005), Microsoft changed the behaviour of the CRT in some
// security related and special situations. The are many situations in which our
// ACE_UnhandledExceptionFilter will never be called. This is a major change to
// the previous versions of the CRT and is not very well documented.
// The CRT simply forces the call to the default-debugger without informing the
// registered unhandled exception filter. Jochen's solution is to stop the CRT
// from calling SetUnhandledExceptionFilter() after we have done so above.
// NOTE this only works for intel based windows builds.
# ifdef _M_IX86
HMODULE hKernel32 = ACE_TEXT_LoadLibrary (ACE_TEXT ("kernel32.dll"));
if (hKernel32)
{
void *pOrgEntry =
GetProcAddress (hKernel32, "SetUnhandledExceptionFilter");
if (pOrgEntry)
{
unsigned char newJump[ 100 ];
DWORD dwOrgEntryAddr = reinterpret_cast<DWORD> (pOrgEntry);
dwOrgEntryAddr += 5; // add 5 for 5 op-codes for jmp far
void *pNewFunc = &ACEdisableSetUnhandledExceptionFilter;
DWORD dwNewEntryAddr = reinterpret_cast<DWORD> (pNewFunc);
DWORD dwRelativeAddr = dwNewEntryAddr - dwOrgEntryAddr;
newJump[ 0 ] = 0xE9; // JMP absolute
ACE_OS::memcpy (&newJump[ 1 ], &dwRelativeAddr, sizeof (pNewFunc));
SIZE_T bytesWritten;
WriteProcessMemory (
GetCurrentProcess (),
pOrgEntry,
newJump,
sizeof (pNewFunc) + 1,
&bytesWritten);
}
}
# endif // _M_IX86
# endif // (_MSC_VER >= 1400) // VC++ 8.0 and above.
#endif /* ACE_DISABLE_WIN32_ERROR_WINDOWS && ACE_WIN32 && !ACE_HAS_WINCE */
@ -380,7 +444,8 @@ ACE_Object_Manager::instance (void)
int
ACE_Object_Manager::at_exit_i (void *object,
ACE_CLEANUP_FUNC cleanup_hook,
void *param)
void *param,
const char* name)
{
ACE_MT (ACE_GUARD_RETURN (ACE_Recursive_Thread_Mutex, ace_mon,
*instance_->internal_lock_, -1));
@ -398,7 +463,22 @@ ACE_Object_Manager::at_exit_i (void *object,
return -1;
}
return exit_info_.at_exit_i (object, cleanup_hook, param);
return exit_info_.at_exit_i (object, cleanup_hook, param, name);
}
int
ACE_Object_Manager::remove_at_exit_i (void *object)
{
ACE_MT (ACE_GUARD_RETURN (ACE_Recursive_Thread_Mutex, ace_mon,
*instance_->internal_lock_, -1));
if (shutting_down_i ())
{
errno = EAGAIN;
return -1;
}
return exit_info_.remove (object);
}
#if defined (ACE_MT_SAFE) && (ACE_MT_SAFE != 0)
@ -467,7 +547,7 @@ ACE_Object_Manager::get_singleton_lock (ACE_Thread_Mutex *&lock)
if (lock == 0)
{
ACE_Cleanup_Adapter<ACE_Thread_Mutex> *lock_adapter;
ACE_Cleanup_Adapter<ACE_Thread_Mutex> *lock_adapter = 0;
ACE_NEW_RETURN (lock_adapter,
ACE_Cleanup_Adapter<ACE_Thread_Mutex>,
-1);
@ -477,7 +557,9 @@ ACE_Object_Manager::get_singleton_lock (ACE_Thread_Mutex *&lock)
// termination. This call will cause us to grab the
// ACE_Object_Manager::instance ()->internal_lock_
// again; that's why it is a recursive lock.
ACE_Object_Manager::at_exit (lock_adapter);
ACE_Object_Manager::at_exit (lock_adapter,
0,
typeid (*lock_adapter).name ());
}
}
}
@ -515,7 +597,7 @@ ACE_Object_Manager::get_singleton_lock (ACE_Mutex *&lock)
if (lock == 0)
{
ACE_Cleanup_Adapter<ACE_Mutex> *lock_adapter;
ACE_Cleanup_Adapter<ACE_Mutex> *lock_adapter = 0;
ACE_NEW_RETURN (lock_adapter,
ACE_Cleanup_Adapter<ACE_Mutex>,
-1);
@ -599,7 +681,7 @@ ACE_Object_Manager::get_singleton_lock (ACE_RW_Thread_Mutex *&lock)
if (lock == 0)
{
ACE_Cleanup_Adapter<ACE_RW_Thread_Mutex> *lock_adapter;
ACE_Cleanup_Adapter<ACE_RW_Thread_Mutex> *lock_adapter = 0;
ACE_NEW_RETURN (lock_adapter,
ACE_Cleanup_Adapter<ACE_RW_Thread_Mutex>,
-1);