summaryrefslogtreecommitdiff
path: root/ace/WIN32_Proactor.cpp
diff options
context:
space:
mode:
authorschmidt <douglascraigschmidt@users.noreply.github.com>1999-06-27 21:11:45 +0000
committerschmidt <douglascraigschmidt@users.noreply.github.com>1999-06-27 21:11:45 +0000
commit6a7014295c46d470f9e92e1e6266076a6b5cb824 (patch)
tree05f19101fdbd55f7b1b4387e11deb70d0f9f7d03 /ace/WIN32_Proactor.cpp
parent951a62b622d40bc7c72e124c8098282fe035affd (diff)
downloadATCD-6a7014295c46d470f9e92e1e6266076a6b5cb824.tar.gz
*** empty log message ***
Diffstat (limited to 'ace/WIN32_Proactor.cpp')
-rw-r--r--ace/WIN32_Proactor.cpp37
1 files changed, 20 insertions, 17 deletions
diff --git a/ace/WIN32_Proactor.cpp b/ace/WIN32_Proactor.cpp
index fc87933c28b..67cf2eb1519 100644
--- a/ace/WIN32_Proactor.cpp
+++ b/ace/WIN32_Proactor.cpp
@@ -19,13 +19,9 @@
class ACE_Export ACE_WIN32_Wakeup_Completion : public ACE_WIN32_Asynch_Result
{
// = TITLE
- //
// This is result object is used by the <end_event_loop> of the
// ACE_Proactor interface to wake up all the threads blocking
// for completions.
- //
- // = DESCRIPTION
- //
public:
ACE_WIN32_Wakeup_Completion (ACE_Handler &handler,
@@ -46,8 +42,6 @@ public:
// This method calls the <handler>'s <handle_wakeup> method.
};
-// *********************************************************************
-
ACE_WIN32_Proactor::ACE_WIN32_Proactor (size_t number_of_threads,
int used_with_reactor_event_loop)
: completion_port_ (0),
@@ -96,13 +90,16 @@ ACE_WIN32_Proactor::register_handle (ACE_HANDLE handle,
this->number_of_threads_);
if (cp == 0)
{
- errno = ::GetLastError ();
+ ACE_OS::set_errno_to_last_error ();
// If errno == ERROR_INVALID_PARAMETER, then this handle was
// already registered.
if (errno != ERROR_INVALID_PARAMETER)
+ // @@ Alex, shouldn't this only be printed if ACE_debug is
+ // beyond a certain level?
ACE_ERROR_RETURN ((LM_ERROR,
ASYS_TEXT ("%p\n"),
- ASYS_TEXT ("CreateIoCompletionPort")), -1);
+ ASYS_TEXT ("CreateIoCompletionPort")),
+ -1);
}
return 0;
}
@@ -357,12 +354,14 @@ ACE_WIN32_Proactor::handle_signal (int, siginfo_t *, ucontext_t *)
// Perform a non-blocking "poll" for all the I/O events that have
// completed in the I/O completion queue.
- ACE_Time_Value timeout (0, 0);
int result = 0;
- while (1)
+ for (ACE_Time_Value timeout (0, 0);
+ ;
+ )
{
result = this->handle_events (timeout);
+
if (result != 0 || errno == ETIME)
break;
}
@@ -420,7 +419,7 @@ ACE_WIN32_Proactor::handle_events (unsigned long milli_seconds)
milli_seconds);
if (result == FALSE && overlapped == 0)
{
- errno = ::GetLastError ();
+ ACE_OS::set_errno_to_last_error ();
if (errno == WAIT_TIMEOUT)
{
@@ -428,6 +427,9 @@ ACE_WIN32_Proactor::handle_events (unsigned long milli_seconds)
return 0;
}
else
+ // @@ Alex, shouldn't this only be printed if ACE_debug is
+ // beyond a certain level?
+
ACE_ERROR_RETURN ((LM_ERROR,
ASYS_TEXT ("%p\n"),
ASYS_TEXT ("GetQueuedCompletionStatus")),
@@ -440,7 +442,7 @@ ACE_WIN32_Proactor::handle_events (unsigned long milli_seconds)
// If errors happen, grab the error.
if (result == FALSE)
- errno = ::GetLastError ();
+ ACE_OS::set_errno_to_last_error ();
else
errno = 0;
@@ -494,7 +496,12 @@ ACE_WIN32_Proactor::post_completion (ACE_WIN32_Asynch_Result *result)
) == FALSE)
{
delete result;
- ACE_ERROR_RETURN ((LM_ERROR, "PostQueuedCompletionStatus failed\n"), -1);
+ // @@ Alex, shouldn't this only be printed if ACE_debug is
+ // beyond a certain level?
+
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "PostQueuedCompletionStatus failed\n"),
+ -1);
}
return 0;
@@ -541,8 +548,6 @@ ACE_WIN32_Proactor::number_of_threads (size_t threads)
this->number_of_threads_ = threads;
}
-// *********************************************************************
-
ACE_WIN32_Asynch_Timer::ACE_WIN32_Asynch_Timer (ACE_Handler &handler,
const void *act,
const ACE_Time_Value &tv,
@@ -570,8 +575,6 @@ ACE_WIN32_Asynch_Timer::complete (u_long bytes_transferred,
this->handler_.handle_time_out (this->time_, this->act ());
}
-// *********************************************************************
-
ACE_WIN32_Wakeup_Completion::ACE_WIN32_Wakeup_Completion (ACE_Handler &handler,
const void *act,
ACE_HANDLE event,