*Massive cleanup (\n\n -> \n, *\n -> \n, cleanup for(...) to for (...), and some other cleanups by hand)
*Fix a possible crash in Spell::DoAllEffectOnTarget --HG-- branch : trunk
This commit is contained in:
@@ -1,5 +1,4 @@
|
||||
// $Id: Thread_Control.cpp 80826 2008-03-04 14:51:23Z wotte $
|
||||
|
||||
// <HACK ON>
|
||||
#include "ace/config-all.h"
|
||||
#if defined (ACE_LEGACY_MODE)
|
||||
@@ -8,18 +7,13 @@
|
||||
# include "ace/Thread_Exit.h"
|
||||
#endif /* ACE_LEGACY_MODE */
|
||||
// </HACK OFF>
|
||||
|
||||
#include "ace/Thread_Control.h"
|
||||
#include "ace/Thread_Manager.h"
|
||||
|
||||
ACE_RCSID(ace, Thread_Control, "$Id: Thread_Control.cpp 80826 2008-03-04 14:51:23Z wotte $")
|
||||
|
||||
#if !defined (ACE_HAS_INLINED_OSCALLS)
|
||||
# include "ace/Thread_Control.inl"
|
||||
#endif /* ACE_HAS_INLINED_OSCALLS */
|
||||
|
||||
ACE_BEGIN_VERSIONED_NAMESPACE_DECL
|
||||
|
||||
void
|
||||
ACE_Thread_Control::dump (void) const
|
||||
{
|
||||
@@ -27,31 +21,25 @@ ACE_Thread_Control::dump (void) const
|
||||
ACE_OS_TRACE ("ACE_Thread_Control::dump");
|
||||
#endif /* ACE_HAS_DUMP */
|
||||
}
|
||||
|
||||
int
|
||||
ACE_Thread_Control::insert (ACE_Thread_Manager *tm, int insert)
|
||||
{
|
||||
ACE_OS_TRACE ("ACE_Thread_Control::insert");
|
||||
|
||||
ACE_hthread_t t_id;
|
||||
ACE_OS::thr_self (t_id);
|
||||
this->tm_ = tm;
|
||||
|
||||
if (insert)
|
||||
return this->tm_->insert_thr (ACE_OS::thr_self (), t_id);
|
||||
else
|
||||
return 0;
|
||||
}
|
||||
|
||||
// Initialize the thread controller.
|
||||
|
||||
ACE_Thread_Control::ACE_Thread_Control (ACE_Thread_Manager *t,
|
||||
int insert)
|
||||
: tm_ (t),
|
||||
status_ (0)
|
||||
{
|
||||
ACE_OS_TRACE ("ACE_Thread_Control::ACE_Thread_Control");
|
||||
|
||||
if (this->tm_ != 0 && insert)
|
||||
{
|
||||
ACE_hthread_t t_id;
|
||||
@@ -59,27 +47,21 @@ ACE_Thread_Control::ACE_Thread_Control (ACE_Thread_Manager *t,
|
||||
this->tm_->insert_thr (ACE_OS::thr_self (), t_id);
|
||||
}
|
||||
}
|
||||
|
||||
// Automatically kill thread on exit.
|
||||
|
||||
ACE_Thread_Control::~ACE_Thread_Control (void)
|
||||
{
|
||||
ACE_OS_TRACE ("ACE_Thread_Control::~ACE_Thread_Control");
|
||||
|
||||
#if defined (ACE_HAS_RECURSIVE_THR_EXIT_SEMANTICS) || defined (ACE_HAS_TSS_EMULATION) || defined (ACE_WIN32)
|
||||
this->exit (this->status_, 0);
|
||||
#else
|
||||
this->exit (this->status_, 1);
|
||||
#endif /* ACE_HAS_RECURSIVE_THR_EXIT_SEMANTICS */
|
||||
}
|
||||
|
||||
// Exit from thread (but clean up first).
|
||||
|
||||
ACE_THR_FUNC_RETURN
|
||||
ACE_Thread_Control::exit (ACE_THR_FUNC_RETURN exit_status, int do_thr_exit)
|
||||
{
|
||||
ACE_OS_TRACE ("ACE_Thread_Control::exit");
|
||||
|
||||
if (this->tm_ != 0)
|
||||
return this->tm_->exit (exit_status, do_thr_exit);
|
||||
else
|
||||
@@ -92,6 +74,5 @@ ACE_Thread_Control::exit (ACE_THR_FUNC_RETURN exit_status, int do_thr_exit)
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
ACE_END_VERSIONED_NAMESPACE_DECL
|
||||
|
||||
|
||||
Reference in New Issue
Block a user