activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tab...@apache.org
Subject svn commit: r920398 - in /activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/util/concurrent: CountDownLatch.cpp CountDownLatch.h
Date Mon, 08 Mar 2010 16:59:32 GMT
Author: tabish
Date: Mon Mar  8 16:59:32 2010
New Revision: 920398

URL: http://svn.apache.org/viewvc?rev=920398&view=rev
Log:
Update the CountDownLatch API to use one type consistantly for a timeout value.

Modified:
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/util/concurrent/CountDownLatch.cpp
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/util/concurrent/CountDownLatch.h

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/util/concurrent/CountDownLatch.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/util/concurrent/CountDownLatch.cpp?rev=920398&r1=920397&r2=920398&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/util/concurrent/CountDownLatch.cpp
(original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/util/concurrent/CountDownLatch.cpp
Mon Mar  8 16:59:32 2010
@@ -17,6 +17,8 @@
 
 #include "CountDownLatch.h"
 
+#include <decaf/lang/exceptions/IllegalArgumentException.h>
+
 using namespace decaf;
 using namespace decaf::lang;
 using namespace decaf::lang::exceptions;
@@ -60,12 +62,17 @@
 }
 
 ////////////////////////////////////////////////////////////////////////////////
-bool CountDownLatch::await( unsigned long timeOut )
+bool CountDownLatch::await( long long timeOut )
     throw ( decaf::lang::exceptions::InterruptedException,
             decaf::lang::Exception ) {
 
     try {
 
+        if( timeOut < 0 ) {
+            throw IllegalArgumentException(
+                __FILE__, __LINE__, "Timeout value cannot be less than zero." );
+        }
+
         synchronized( &mutex ) {
             if( count == 0 ){
                 return true;

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/util/concurrent/CountDownLatch.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/util/concurrent/CountDownLatch.h?rev=920398&r1=920397&r2=920398&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/util/concurrent/CountDownLatch.h
(original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/util/concurrent/CountDownLatch.h
Mon Mar  8 16:59:32 2010
@@ -107,7 +107,7 @@
          * @throws InterruptedException - if the current thread is interrupted while waiting.
          * @throws Exception - if any other error occurs.
          */
-        virtual bool await( unsigned long timeOut )
+        virtual bool await( long long timeOut )
             throw ( decaf::lang::exceptions::InterruptedException,
                     decaf::lang::Exception );
 



Mime
View raw message