Author: tabish
Date: Sun Nov 11 11:12:12 2007
New Revision: 593942
URL: http://svn.apache.org/viewvc?rev=593942&view=rev
Log:
http://issues.apache.org/activemq/browse/AMQCPP-103
Modified:
activemq/activemq-cpp/decaf/trunk/src/main/decaf/io/BlockingByteArrayInputStream.cpp
Modified:
activemq/activemq-cpp/decaf/trunk/src/main/decaf/io/BlockingByteArrayInputStream.cpp
URL:
http://svn.apache.org/viewvc/activemq/activemq-cpp/decaf/trunk/src/main/decaf/io/BlockingByteArrayInputStream.cpp?rev=593942&r1=593941&r2=593942&view=diff
==============================================================================
---
activemq/activemq-cpp/decaf/trunk/src/main/decaf/io/BlockingByteArrayInputStream.cpp
(original)
+++
activemq/activemq-cpp/decaf/trunk/src/main/decaf/io/BlockingByteArrayInputStream.cpp
Sun Nov 11 11:12:12 2007
@@ -83,22 +83,26 @@
////////////////////////////////////////////////////////////////////////////////
unsigned char BlockingByteArrayInputStream::read() throw ( IOException ){
- synchronized( this ){
+ try{
+ synchronized( this ){
- while( !closing ){
+ while( !closing ){
- if( pos != buffer.end() ){
- return *(pos++);
+ if( pos != buffer.end() ){
+ return *(pos++);
+ }
+
+ // Wait for more data
+ wait();
}
- // Wait for more data
- wait();
+ throw IOException( __FILE__, __LINE__, "close occurred during
read" );
}
- throw IOException( __FILE__, __LINE__, "close occurred during read" );
+ return 0;
}
-
- return 0;
+ DECAF_CATCH_RETHROW( IOException )
+ DECAF_CATCHALL_THROW( IOException )
}
////////////////////////////////////////////////////////////////////////////////