summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSteve Huston <shuston@riverace.com>2006-03-01 00:21:39 +0000
committerSteve Huston <shuston@riverace.com>2006-03-01 00:21:39 +0000
commit94ba77d11f7bc225cf1084ca4137aebbb5bf829a (patch)
tree46eb912b35079df631a20a79e7af2a69c906099a
parent659668bc4f73051a471e28299bcfdd830c08b1b9 (diff)
downloadATCD-94ba77d11f7bc225cf1084ca4137aebbb5bf829a.tar.gz
ChangeLogTag:Wed Mar 1 00:16:26 UTC 2006 Steve Huston <shuston@riverace.com>
-rw-r--r--ChangeLog13
-rw-r--r--ace/Recursive_Thread_Mutex.cpp7
-rw-r--r--tests/Reactor_Dispatch_Order_Test.cpp70
3 files changed, 60 insertions, 30 deletions
diff --git a/ChangeLog b/ChangeLog
index 5275cde5628..c159f373018 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,16 @@
+Wed Mar 1 00:16:26 UTC 2006 Steve Huston <shuston@riverace.com>
+
+ * ace/Recursive_Thread_Mutex.cpp (get_nesting_level): On Win64 with
+ AMD64/EM64T, use the CRITICAL_SECTION's RecursionCount member, not
+ LockCount, as was changed in this entry:
+ Tue May 6 11:50:18 2003 Chad Elliott <elliott_c@ociweb.com>
+ It remains to be seen under what conditions LockCount is used (it
+ may be for Itanium, for example) but for now, use of RecursionCount
+ is conditional to AMD64.
+
+ * tests/Reactor_Dispatch_Order_Test.cpp: Print some useful order info
+ rather than ACE_ASSERT everywhere. Also fixed some ACE_TEXT stuff.
+
Tue Feb 28 23:28:57 UTC 2006 J.T. Conklin <jtc@acorntoolworks.com>
* ace/Makefile.am:
diff --git a/ace/Recursive_Thread_Mutex.cpp b/ace/Recursive_Thread_Mutex.cpp
index c8a1ac9bdf3..ccb59b1064d 100644
--- a/ace/Recursive_Thread_Mutex.cpp
+++ b/ace/Recursive_Thread_Mutex.cpp
@@ -92,8 +92,11 @@ ACE_Recursive_Thread_Mutex::get_nesting_level (void)
#elif defined (ACE_HAS_RECURSIVE_MUTEXES)
// Nothing inside of a CRITICAL_SECTION object should ever be
// accessed directly. It is documented to change at any time.
-# if defined (ACE_WIN64)
- // Things are different on Windows XP 64-bit
+# if defined (ACE_WIN64) && !defined(_M_AMD64)
+ // Things are different on Windows XP 64-bit. However, as of Feb 2006
+ // Windows XP 64-bit edition on Intel EM64T w/ VC8, LockCount is
+ // decremented at first acquire and then doesn't change. RecursionCount,
+ // however, works the same as Win32, below.
return this->lock_.LockCount + 1;
# elif defined (ACE_WIN32)
// This is really a Win32-ism...
diff --git a/tests/Reactor_Dispatch_Order_Test.cpp b/tests/Reactor_Dispatch_Order_Test.cpp
index fe3b7a6adc5..d6263f091d3 100644
--- a/tests/Reactor_Dispatch_Order_Test.cpp
+++ b/tests/Reactor_Dispatch_Order_Test.cpp
@@ -65,16 +65,25 @@ Handler::Handler (ACE_Reactor &reactor)
dispatch_order_ (1)
{
// Create the pipe.
- int result
- = this->pipe_.open ();
- ACE_ASSERT (result == 0);
-
- // Register for all events.
- result =
- this->reactor ()->register_handler (this->pipe_.read_handle (),
- this,
- ACE_Event_Handler::ALL_EVENTS_MASK);
- ACE_ASSERT (result == 0);
+ bool ok = true;
+ if (0 != this->pipe_.open ())
+ {
+ ACE_ERROR ((LM_ERROR, ACE_TEXT ("%p\n"), ACE_TEXT ("pipe")));
+ ok = false;
+ }
+ else
+ {
+ // Register for all events.
+ if (0 != this->reactor ()->register_handler
+ (this->pipe_.read_handle (),
+ this,
+ ACE_Event_Handler::ALL_EVENTS_MASK))
+ {
+ ACE_ERROR ((LM_ERROR, ACE_TEXT ("%p\n"), ACE_TEXT ("register")));
+ ok = false;
+ }
+ }
+ ACE_ASSERT (ok);
}
Handler::~Handler (void)
@@ -86,10 +95,13 @@ int
Handler::handle_timeout (const ACE_Time_Value &,
const void *)
{
- ACE_ASSERT (this->dispatch_order_++ == 1);
-
- ACE_DEBUG ((LM_DEBUG,
- "Handler::handle_timeout\n"));
+ int me = this->dispatch_order_++;
+ if (me != 1)
+ ACE_ERROR ((LM_ERROR,
+ ACE_TEXT ("handle_timeout should be #1; it's %d\n"),
+ me));
+ else
+ ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("Handler::handle_timeout\n")));
return 0;
}
@@ -97,10 +109,13 @@ Handler::handle_timeout (const ACE_Time_Value &,
int
Handler::handle_output (ACE_HANDLE)
{
- ACE_ASSERT (this->dispatch_order_++ == 2);
-
- ACE_DEBUG ((LM_DEBUG,
- "Handler::handle_output\n"));
+ int me = this->dispatch_order_++;
+ if (me != 2)
+ ACE_ERROR ((LM_ERROR,
+ ACE_TEXT ("handle_output should be #2; it's %d\n"),
+ me));
+ else
+ ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("Handler::handle_output\n")));
#if defined (__OpenBSD__) || defined (ACE_VXWORKS) || defined (__Lynx__)
// All that we need written has been written, so don't
@@ -116,20 +131,19 @@ Handler::handle_output (ACE_HANDLE)
int
Handler::handle_input (ACE_HANDLE fd)
{
- ACE_ASSERT (this->dispatch_order_++ == 3);
+ int me = this->dispatch_order_++;
+ if (me != 3)
+ ACE_ERROR ((LM_ERROR,
+ ACE_TEXT ("handle_timeout should be #3; it's %d\n"),
+ me));
char buffer[BUFSIZ];
- ssize_t result =
- ACE::recv (fd,
- buffer,
- sizeof buffer);
+ ssize_t result = ACE::recv (fd, buffer, sizeof buffer);
ACE_ASSERT (result == ssize_t (ACE_OS::strlen (message)));
buffer[result] = '\0';
- ACE_DEBUG ((LM_DEBUG,
- "Handler::handle_input: %s\n",
- ACE_TEXT_CHAR_TO_TCHAR (buffer)));
+ ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("Handler::handle_input: %C\n"), buffer));
ACE_ASSERT (ACE_OS::strcmp (buffer,
message) == 0);
@@ -174,7 +188,7 @@ run_main (int, ACE_TCHAR *[])
ACE_Select_Reactor select_reactor_impl;
ACE_Reactor select_reactor (&select_reactor_impl);
-
+ ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("Testing ACE_Select_Reactor\n")));
test_reactor_dispatch_order (select_reactor);
// WinCE can't do the necessary Winsock 2 things for WFMO_Reactor.
@@ -182,7 +196,7 @@ run_main (int, ACE_TCHAR *[])
ACE_WFMO_Reactor wfmo_reactor_impl;
ACE_Reactor wfmo_reactor (&wfmo_reactor_impl);
-
+ ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("Testing ACE_WFMO_Reactor\n")));
test_reactor_dispatch_order (wfmo_reactor);
#endif /* ACE_WIN32 && !ACE_HAS_WINCE */