summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorlevine <levine@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>1998-02-18 18:24:17 +0000
committerlevine <levine@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>1998-02-18 18:24:17 +0000
commit1fd1c5e39e47599dcbdb8af56c1abcddf361cff8 (patch)
tree33e6475bf58771409348a1f1c0a5b7273d4cbc7b /tests
parentd28a3dcf26e37de0339ffdd9a47b109d61ef0050 (diff)
downloadATCD-1fd1c5e39e47599dcbdb8af56c1abcddf361cff8.tar.gz
(Consumer::svc): added a thr_yield so that the test magically works on
LynxOS. It looks like pthread_cond_{,timed}wait is busted on LynxOS, we're investigating it.
Diffstat (limited to 'tests')
-rw-r--r--tests/Buffer_Stream_Test.cpp29
1 files changed, 18 insertions, 11 deletions
diff --git a/tests/Buffer_Stream_Test.cpp b/tests/Buffer_Stream_Test.cpp
index f1049f19fe1..1756862dc9c 100644
--- a/tests/Buffer_Stream_Test.cpp
+++ b/tests/Buffer_Stream_Test.cpp
@@ -89,9 +89,9 @@ int
Common_Task::close (u_long exit_status)
{
ACE_DEBUG ((LM_DEBUG,
- "(%t) thread is exiting with status %d in module %s\n",
- exit_status,
- this->name ()));
+ "(%t) thread is exiting with status %d in module %s\n",
+ exit_status,
+ this->name ()));
// Can do anything here that is required when a thread exits, e.g.,
// storing thread-specific information in some other storage
@@ -125,7 +125,7 @@ Supplier::svc (void)
mb->wr_ptr (2);
if (this->put_next (mb) == -1)
- ACE_ERROR ((LM_ERROR, "(%t) %p\n", "put_next"));
+ ACE_ERROR ((LM_ERROR, "(%t) %p\n", "put_next"));
}
ACE_NEW_RETURN(mb, ACE_Message_Block, -1);
@@ -161,25 +161,32 @@ Consumer::svc (void)
for (;;)
{
+#if defined (__Lynx__)
+ // ACE_OS::pthread_cond_timedwait () doesn't work on LynxOS. Until
+ // we figure that out, this thr_yield () pertrubs the test enough
+ // so that it is never called.
+ ACE_OS::thr_yield ();
+#endif /* __Lynx__ */
+
this->timeout_.sec (ACE_OS::time (0) + 4); // Wait for upto 4 seconds
result = this->getq (mb, &this->timeout_);
if (result == -1)
- break;
+ break;
int length = mb->length ();
if (length > 0)
- {
- output = mb->rd_ptr ();
- ACE_ASSERT (*c == output[0]);
- c++;
- }
+ {
+ output = mb->rd_ptr ();
+ ACE_ASSERT (*c == output[0]);
+ c++;
+ }
mb->release ();
if (length == 0)
- break;
+ break;
}
ACE_ASSERT (result == 0 || errno == EWOULDBLOCK);