ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/jsr166/jsr166/src/main/java/util/concurrent/Exchanger.java
(Generate patch)

Comparing jsr166/src/main/java/util/concurrent/Exchanger.java (file contents):
Revision 1.6 by tim, Wed Aug 6 18:22:09 2003 UTC vs.
Revision 1.7 by tim, Fri Aug 8 20:05:07 2003 UTC

# Line 34 | Line 34 | import java.util.concurrent.locks.*;
34   *           if (currentBuffer.full())
35   *             currentBuffer = exchanger.exchange(currentBuffer);
36   *         }
37 < *       }
38 < *       catch (InterruptedException ex) { ... handle ... }
37 > *       } catch (InterruptedException ex) { ... handle ... }
38   *     }
39   *   }
40   *
# Line 48 | Line 47 | import java.util.concurrent.locks.*;
47   *           if (currentBuffer.empty())
48   *             currentBuffer = exchanger.exchange(currentBuffer);
49   *         }
50 < *       }
52 < *       catch (InterruptedException ex) { ... handle ...}
50 > *       } catch (InterruptedException ex) { ... handle ...}
51   *     }
52   *   }
53   *
# Line 124 | Line 122 | public class Exchanger<V> {
122                      else
123                          break; // timed out
124                  }
125 <            }
128 <            catch (InterruptedException ie) {
125 >            } catch (InterruptedException ie) {
126                  interrupted = ie;
127              }
128  
# Line 150 | Line 147 | public class Exchanger<V> {
147                  throw interrupted;
148              else  // must be timeout
149                  throw new TimeoutException();
150 <        }
154 <        finally {
150 >        } finally {
151              lock.unlock();
152          }
153      }
# Line 196 | Line 192 | public class Exchanger<V> {
192      public V exchange(V x) throws InterruptedException {
193          try {
194              return doExchange(x, false, 0);
195 <        }
200 <        catch (TimeoutException cannotHappen) {
195 >        } catch (TimeoutException cannotHappen) {
196              throw new Error(cannotHappen);
197          }
198      }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines