summaryrefslogtreecommitdiff
path: root/ACE/ace
diff options
context:
space:
mode:
authorJohnny Willemsen <jwillemsen@remedy.nl>2007-12-15 15:01:23 +0000
committerJohnny Willemsen <jwillemsen@remedy.nl>2007-12-15 15:01:23 +0000
commit2c949803f4ebcfb3771b7e560cbebdecbb70e074 (patch)
treed992f733c4865f739e10b150a7fa5c6f28969412 /ACE/ace
parenta2f3cd42eaeaa4f7ab870372a28a04f70a246c1c (diff)
downloadATCD-2c949803f4ebcfb3771b7e560cbebdecbb70e074.tar.gz
Sat Dec 15 14:57:12 UTC 2007 Johnny Willemsen <jwillemsen@remedy.nl>
Diffstat (limited to 'ACE/ace')
-rw-r--r--ACE/ace/Object_Manager.cpp3
-rw-r--r--ACE/ace/Svc_Conf.h7
-rw-r--r--ACE/ace/TP_Reactor.cpp43
-rw-r--r--ACE/ace/Token.cpp64
4 files changed, 46 insertions, 71 deletions
diff --git a/ACE/ace/Object_Manager.cpp b/ACE/ace/Object_Manager.cpp
index d5cfc2eb357..313eb6a116a 100644
--- a/ACE/ace/Object_Manager.cpp
+++ b/ACE/ace/Object_Manager.cpp
@@ -251,6 +251,9 @@ ACE_Object_Manager::init (void)
_CrtSetReportFile( _CRT_ERROR, _CRTDBG_FILE_STDERR );
#endif /* _DEBUG && _MSC_VER || __INTEL_COMPILER */
+ // The system does not display the critical-error-handler message box
+ SetErrorMode(SEM_FAILCRITICALERRORS);
+
// And this will catch all unhandled exceptions.
SetUnhandledExceptionFilter (&ACE_UnhandledExceptionFilter);
#endif /* ACE_DISABLE_WIN32_ERROR_WINDOWS && ACE_WIN32 && !ACE_HAS_WINCE */
diff --git a/ACE/ace/Svc_Conf.h b/ACE/ace/Svc_Conf.h
index a62da127abf..2038519c6f7 100644
--- a/ACE/ace/Svc_Conf.h
+++ b/ACE/ace/Svc_Conf.h
@@ -36,14 +36,7 @@ ACE_BEGIN_VERSIONED_NAMESPACE_DECL
// The following yylex() declarations require support for reentrant
// parser generation (e.g. from GNU Bison).
-#if defined (DEBUGGING)
-#if defined (ACE_YY_DECL)
-#undef ACE_YY_DECL
-#endif /* ACE_YY_DECL */
-#define ACE_YY_DECL extern "C" char *ace_yylex (ACE_YYSTYPE *ace_yylval, void *ACE_YYLEX_PARAM)
-#else
#define ACE_YY_DECL extern "C" int ace_yylex (ACE_YYSTYPE *ace_yylval, void *ACE_YYLEX_PARAM)
-#endif /* DEBUGGING */
// Forward declarations
class ACE_Location_Node;
diff --git a/ACE/ace/TP_Reactor.cpp b/ACE/ace/TP_Reactor.cpp
index 37c114703a9..4216fa3db15 100644
--- a/ACE/ace/TP_Reactor.cpp
+++ b/ACE/ace/TP_Reactor.cpp
@@ -170,20 +170,18 @@ ACE_TP_Reactor::handle_events (ACE_Time_Value *max_wait_time)
// Update the countdown to reflect time waiting for the token.
countdown.update ();
- return this->dispatch_i (max_wait_time,
- guard);
+ return this->dispatch_i (max_wait_time, guard);
}
int
ACE_TP_Reactor::dispatch_i (ACE_Time_Value *max_wait_time,
ACE_TP_Token_Guard &guard)
{
- int event_count =
- this->get_event_for_dispatching (max_wait_time);
+ int event_count = this->get_event_for_dispatching (max_wait_time);
// We use this count to detect potential infinite loops as described
// in bug 2540.
- int initial_event_count = event_count;
+ int const initial_event_count = event_count;
int result = 0;
@@ -205,8 +203,7 @@ ACE_TP_Reactor::dispatch_i (ACE_Time_Value *max_wait_time,
// now is not the right thing...
//
// @@ We need to do better..
- return this->handle_signals (event_count,
- guard);
+ return this->handle_signals (event_count, guard);
}
#endif // #if 0
@@ -221,8 +218,7 @@ ACE_TP_Reactor::dispatch_i (ACE_Time_Value *max_wait_time,
// need to do that. In the future we *may* have the timers also
// returned through the <event_count>. Just passing that along for
// that day.
- result = this->handle_timer_events (event_count,
- guard);
+ result = this->handle_timer_events (event_count, guard);
if (result > 0)
return result;
@@ -234,8 +230,7 @@ ACE_TP_Reactor::dispatch_i (ACE_Time_Value *max_wait_time,
// Next dispatch the notification handlers (if there are any to
// dispatch). These are required to handle multiple-threads
// that are trying to update the <Reactor>.
- result = this->handle_notify_events (event_count,
- guard);
+ result = this->handle_notify_events (event_count, guard);
if (result > 0)
return result;
@@ -249,8 +244,7 @@ ACE_TP_Reactor::dispatch_i (ACE_Time_Value *max_wait_time,
result = this->handle_socket_events (event_count, guard);
}
- if (event_count != 0
- && event_count == initial_event_count)
+ if (event_count != 0 && event_count == initial_event_count)
{
this->state_changed_ = true;
}
@@ -326,27 +320,21 @@ ACE_TP_Reactor::handle_timer_events (int & /*event_count*/,
// time.
ACE_Timer_Node_Dispatch_Info info;
- if (this->timer_queue_->dispatch_info (cur_time,
- info))
+ if (this->timer_queue_->dispatch_info (cur_time, info))
{
const void *upcall_act = 0;
// Preinvoke.
- this->timer_queue_->preinvoke (info,
- cur_time,
- upcall_act);
+ this->timer_queue_->preinvoke (info, cur_time, upcall_act);
// Release the token before dispatching notifies...
guard.release_token ();
// call the functor
- this->timer_queue_->upcall (info,
- cur_time);
+ this->timer_queue_->upcall (info, cur_time);
// Postinvoke
- this->timer_queue_->postinvoke (info,
- cur_time,
- upcall_act);
+ this->timer_queue_->postinvoke (info, cur_time, upcall_act);
// We have dispatched a timer
return 1;
@@ -360,8 +348,7 @@ ACE_TP_Reactor::handle_notify_events (int & /*event_count*/,
ACE_TP_Token_Guard &guard)
{
// Get the handle on which notify calls could have occured
- ACE_HANDLE notify_handle =
- this->get_notify_handle ();
+ ACE_HANDLE notify_handle = this->get_notify_handle ();
int result = 0;
@@ -378,8 +365,7 @@ ACE_TP_Reactor::handle_notify_events (int & /*event_count*/,
// Keep reading notifies till we empty it or till we have a
// dispatchable buffer
- while (this->notify_handler_->read_notify_pipe (notify_handle,
- buffer) > 0)
+ while (this->notify_handler_->read_notify_pipe (notify_handle, buffer) > 0)
{
// Just figure out whether we can read any buffer that has
// dispatchable info. If not we have just been unblocked by
@@ -487,8 +473,7 @@ ACE_TP_Reactor::get_event_for_dispatching (ACE_Time_Value *max_wait_time)
this->ready_set_.ex_mask_.sync (this->ready_set_.ex_mask_.max_set ());
}
- return this->wait_for_multiple_events (this->ready_set_,
- max_wait_time);
+ return this->wait_for_multiple_events (this->ready_set_, max_wait_time);
}
int
diff --git a/ACE/ace/Token.cpp b/ACE/ace/Token.cpp
index 85fa9cf5b66..a209b02183d 100644
--- a/ACE/ace/Token.cpp
+++ b/ACE/ace/Token.cpp
@@ -13,10 +13,10 @@ ACE_RCSID(ace, Token, "$Id$")
#include "ace/Thread.h"
#include "ace/Log_Msg.h"
-#if defined (DEBUGGING)
+#if defined (ACE_TOKEN_DEBUGGING)
// FUZZ: disable check_for_streams_include
#include "ace/streams.h"
-#endif /* DEBUGGING */
+#endif /* ACE_TOKEN_DEBUGGING */
ACE_BEGIN_VERSIONED_NAMESPACE_DECL
@@ -189,11 +189,11 @@ ACE_Token::shared_acquire (void (*sleep_hook_func)(void *),
ACE_TRACE ("ACE_Token::shared_acquire");
ACE_GUARD_RETURN (ACE_Thread_Mutex, ace_mon, this->lock_, -1);
-#if defined (DEBUGGING)
+#if defined (ACE_TOKEN_DEBUGGING)
this->dump ();
-#endif /* DEBUGGING */
+#endif /* ACE_TOKEN_DEBUGGING */
- ACE_thread_t thr_id = ACE_Thread::self ();
+ ACE_thread_t const thr_id = ACE_Thread::self ();
// Nobody holds the token.
if (!this->in_use_)
@@ -255,14 +255,13 @@ ACE_Token::shared_acquire (void (*sleep_hook_func)(void *),
++ret;
}
- int timed_out = 0;
- int error = 0;
+ bool timed_out = false;
+ bool error = false;
// Sleep until we've got the token (ignore signals).
do
{
- int result = my_entry.wait (timeout,
- this->lock_);
+ int const result = my_entry.wait (timeout, this->lock_);
if (result == -1)
{
@@ -271,19 +270,19 @@ ACE_Token::shared_acquire (void (*sleep_hook_func)(void *),
if (errno == EINTR)
continue;
-#if defined (DEBUGGING)
+#if defined (ACE_TOKEN_DEBUGGING)
cerr << '(' << ACE_Thread::self () << ')'
<< " acquire: "
<< (errno == ETIME ? "timed out" : "error occurred")
<< endl;
-#endif /* DEBUGGING */
+#endif /* ACE_TOKEN_DEBUGGING */
// We come here if a timeout occurs or some serious
// ACE_Condition object error.
if (errno == ETIME)
- timed_out = 1;
+ timed_out = true;
else
- error = 1;
+ error = true;
// Stop the loop.
break;
@@ -295,10 +294,9 @@ ACE_Token::shared_acquire (void (*sleep_hook_func)(void *),
--this->waiters_;
queue->remove_entry (&my_entry);
-#if defined (DEBUGGING)
- cerr << '(' << ACE_Thread::self () << ')'
- << " acquire (UNBLOCKED)" << endl;
-#endif /* DEBUGGING */
+#if defined (ACE_TOKEN_DEBUGGING)
+ ACE_DEBUG ((LM_DEBUG, "(%t) ACE_Token::shared_acquire (UNBLOCKED)\n"));
+#endif /* ACE_TOKEN_DEBUGGING */
// If timeout occured
if (timed_out)
@@ -362,9 +360,9 @@ ACE_Token::renew (int requeue_position,
ACE_TRACE ("ACE_Token::renew");
ACE_GUARD_RETURN (ACE_Thread_Mutex, ace_mon, this->lock_, -1);
-#if defined (DEBUGGING)
+#if defined (ACE_TOKEN_DEBUGGING)
this->dump ();
-#endif /* DEBUGGING */
+#endif /* ACE_TOKEN_DEBUGGING */
// ACE_ASSERT (ACE_OS::thr_equal (ACE_Thread::self (), this->owner_));
// Check to see if there are any waiters worth giving up the lock
@@ -403,14 +401,13 @@ ACE_Token::renew (int requeue_position,
// Wakeup waiter.
this->wakeup_next_waiter ();
- int timed_out = 0;
- int error = 0;
+ bool timed_out = false;
+ bool error = false;
// Sleep until we've got the token (ignore signals).
do
{
- int result = my_entry.wait (timeout,
- this->lock_);
+ int const result = my_entry.wait (timeout, this->lock_);
if (result == -1)
{
@@ -419,19 +416,19 @@ ACE_Token::renew (int requeue_position,
if (errno == EINTR)
continue;
-#if defined (DEBUGGING)
+#if defined (ACE_TOKEN_DEBUGGING)
cerr << '(' << ACE_Thread::self () << ')'
<< " renew: "
<< (errno == ETIME ? "timed out" : "error occurred")
<< endl;
-#endif /* DEBUGGING */
+#endif /* ACE_TOKEN_DEBUGGING */
// We come here if a timeout occurs or some serious
// ACE_Condition object error.
if (errno == ETIME)
- timed_out = 1;
+ timed_out = true;
else
- error = 1;
+ error = true;
// Stop the loop.
break;
@@ -443,10 +440,9 @@ ACE_Token::renew (int requeue_position,
--this->waiters_;
this_threads_queue->remove_entry (&my_entry);
-#if defined (DEBUGGING)
- cerr << '(' << ACE_Thread::self () << ')'
- << " acquire (UNBLOCKED)" << endl;
-#endif /* DEBUGGING */
+#if defined (ACE_TOKEN_DEBUGGING)
+ ACE_DEBUG ((LM_DEBUG, "(%t) ACE_Token::renew (UNBLOCKED)\n"));
+#endif /* ACE_TOKEN_DEBUGGING */
// If timeout occured
if (timed_out)
@@ -485,11 +481,9 @@ ACE_Token::release (void)
ACE_TRACE ("ACE_Token::release");
ACE_GUARD_RETURN (ACE_Thread_Mutex, ace_mon, this->lock_, -1);
- // ACE_ASSERT (ACE_OS::thr_equal (ACE_Thread::self (), this->owner_));
-
-#if defined (DEBUGGING)
+#if defined (ACE_TOKEN_DEBUGGING)
this->dump ();
-#endif /* DEBUGGING */
+#endif /* ACE_TOKEN_DEBUGGING */
// Nested release...
if (this->nesting_level_ > 0)