Uninterruptibles.java 14.6 KB
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537
package com.google.common.util.concurrent;

import com.google.common.annotations.Beta;
import java.util.concurrent.BlockingQueue;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.Future;
import java.util.concurrent.Semaphore;
import java.util.concurrent.TimeUnit;

@Beta
public final class Uninterruptibles
{
  public static void awaitUninterruptibly(CountDownLatch paramCountDownLatch)
  {
    int i = 0;
    try
    {
      paramCountDownLatch.await();
      if (i != 0) {
        Thread.currentThread().interrupt();
      }
      return;
    }
    catch (InterruptedException localInterruptedException)
    {
      for (;;)
      {
        localInterruptedException = localInterruptedException;
        i = 1;
      }
    }
    finally
    {
      paramCountDownLatch = finally;
      if (i != 0) {
        Thread.currentThread().interrupt();
      }
      throw paramCountDownLatch;
    }
  }
  
  /* Error */
  public static boolean awaitUninterruptibly(CountDownLatch paramCountDownLatch, long paramLong, TimeUnit paramTimeUnit)
  {
    // Byte code:
    //   0: iconst_0
    //   1: istore 6
    //   3: iconst_0
    //   4: istore 5
    //   6: iload 6
    //   8: istore 4
    //   10: aload_3
    //   11: lload_1
    //   12: invokevirtual 35	java/util/concurrent/TimeUnit:toNanos	(J)J
    //   15: lstore 7
    //   17: iload 6
    //   19: istore 4
    //   21: invokestatic 41	java/lang/System:nanoTime	()J
    //   24: lstore 9
    //   26: lload 7
    //   28: lstore_1
    //   29: iload 5
    //   31: istore 4
    //   33: aload_0
    //   34: lload_1
    //   35: getstatic 45	java/util/concurrent/TimeUnit:NANOSECONDS	Ljava/util/concurrent/TimeUnit;
    //   38: invokevirtual 48	java/util/concurrent/CountDownLatch:await	(JLjava/util/concurrent/TimeUnit;)Z
    //   41: istore 11
    //   43: iload 5
    //   45: ifeq +9 -> 54
    //   48: invokestatic 25	java/lang/Thread:currentThread	()Ljava/lang/Thread;
    //   51: invokevirtual 28	java/lang/Thread:interrupt	()V
    //   54: iload 11
    //   56: ireturn
    //   57: astore_3
    //   58: iconst_1
    //   59: istore 4
    //   61: iconst_1
    //   62: istore 5
    //   64: invokestatic 41	java/lang/System:nanoTime	()J
    //   67: lstore_1
    //   68: lload 9
    //   70: lload 7
    //   72: ladd
    //   73: lload_1
    //   74: lsub
    //   75: lstore_1
    //   76: goto -47 -> 29
    //   79: astore_0
    //   80: iload 4
    //   82: ifeq +9 -> 91
    //   85: invokestatic 25	java/lang/Thread:currentThread	()Ljava/lang/Thread;
    //   88: invokevirtual 28	java/lang/Thread:interrupt	()V
    //   91: aload_0
    //   92: athrow
    // Local variable table:
    //   start	length	slot	name	signature
    //   0	93	0	paramCountDownLatch	CountDownLatch
    //   0	93	1	paramLong	long
    //   0	93	3	paramTimeUnit	TimeUnit
    //   8	73	4	i	int
    //   4	59	5	j	int
    //   1	17	6	k	int
    //   15	56	7	l1	long
    //   24	45	9	l2	long
    //   41	14	11	bool	boolean
    // Exception table:
    //   from	to	target	type
    //   33	43	57	java/lang/InterruptedException
    //   10	17	79	finally
    //   21	26	79	finally
    //   33	43	79	finally
    //   64	68	79	finally
  }
  
  public static <V> V getUninterruptibly(Future<V> paramFuture)
    throws ExecutionException
  {
    int i = 0;
    try
    {
      Object localObject = paramFuture.get();
      if (i != 0) {
        Thread.currentThread().interrupt();
      }
      return (V)localObject;
    }
    catch (InterruptedException localInterruptedException)
    {
      for (;;)
      {
        localInterruptedException = localInterruptedException;
        i = 1;
      }
    }
    finally
    {
      paramFuture = finally;
      if (i != 0) {
        Thread.currentThread().interrupt();
      }
      throw paramFuture;
    }
  }
  
  /* Error */
  public static <V> V getUninterruptibly(Future<V> paramFuture, long paramLong, TimeUnit paramTimeUnit)
    throws ExecutionException, java.util.concurrent.TimeoutException
  {
    // Byte code:
    //   0: iconst_0
    //   1: istore 6
    //   3: iconst_0
    //   4: istore 5
    //   6: iload 6
    //   8: istore 4
    //   10: aload_3
    //   11: lload_1
    //   12: invokevirtual 35	java/util/concurrent/TimeUnit:toNanos	(J)J
    //   15: lstore 7
    //   17: iload 6
    //   19: istore 4
    //   21: invokestatic 41	java/lang/System:nanoTime	()J
    //   24: lstore 9
    //   26: lload 7
    //   28: lstore_1
    //   29: iload 5
    //   31: istore 4
    //   33: aload_0
    //   34: lload_1
    //   35: getstatic 45	java/util/concurrent/TimeUnit:NANOSECONDS	Ljava/util/concurrent/TimeUnit;
    //   38: invokeinterface 67 4 0
    //   43: astore_3
    //   44: iload 5
    //   46: ifeq +9 -> 55
    //   49: invokestatic 25	java/lang/Thread:currentThread	()Ljava/lang/Thread;
    //   52: invokevirtual 28	java/lang/Thread:interrupt	()V
    //   55: aload_3
    //   56: areturn
    //   57: astore_3
    //   58: iconst_1
    //   59: istore 4
    //   61: iconst_1
    //   62: istore 5
    //   64: invokestatic 41	java/lang/System:nanoTime	()J
    //   67: lstore_1
    //   68: lload 9
    //   70: lload 7
    //   72: ladd
    //   73: lload_1
    //   74: lsub
    //   75: lstore_1
    //   76: goto -47 -> 29
    //   79: astore_0
    //   80: iload 4
    //   82: ifeq +9 -> 91
    //   85: invokestatic 25	java/lang/Thread:currentThread	()Ljava/lang/Thread;
    //   88: invokevirtual 28	java/lang/Thread:interrupt	()V
    //   91: aload_0
    //   92: athrow
    // Local variable table:
    //   start	length	slot	name	signature
    //   0	93	0	paramFuture	Future<V>
    //   0	93	1	paramLong	long
    //   0	93	3	paramTimeUnit	TimeUnit
    //   8	73	4	i	int
    //   4	59	5	j	int
    //   1	17	6	k	int
    //   15	56	7	l1	long
    //   24	45	9	l2	long
    // Exception table:
    //   from	to	target	type
    //   33	44	57	java/lang/InterruptedException
    //   10	17	79	finally
    //   21	26	79	finally
    //   33	44	79	finally
    //   64	68	79	finally
  }
  
  public static void joinUninterruptibly(Thread paramThread)
  {
    int i = 0;
    try
    {
      paramThread.join();
      if (i != 0) {
        Thread.currentThread().interrupt();
      }
      return;
    }
    catch (InterruptedException localInterruptedException)
    {
      for (;;)
      {
        localInterruptedException = localInterruptedException;
        i = 1;
      }
    }
    finally
    {
      paramThread = finally;
      if (i != 0) {
        Thread.currentThread().interrupt();
      }
      throw paramThread;
    }
  }
  
  /* Error */
  public static void joinUninterruptibly(Thread paramThread, long paramLong, TimeUnit paramTimeUnit)
  {
    // Byte code:
    //   0: aload_0
    //   1: invokestatic 80	com/google/common/base/Preconditions:checkNotNull	(Ljava/lang/Object;)Ljava/lang/Object;
    //   4: pop
    //   5: iconst_0
    //   6: istore 6
    //   8: iconst_0
    //   9: istore 5
    //   11: iload 6
    //   13: istore 4
    //   15: aload_3
    //   16: lload_1
    //   17: invokevirtual 35	java/util/concurrent/TimeUnit:toNanos	(J)J
    //   20: lstore 7
    //   22: iload 6
    //   24: istore 4
    //   26: invokestatic 41	java/lang/System:nanoTime	()J
    //   29: lstore 9
    //   31: lload 7
    //   33: lstore_1
    //   34: iload 5
    //   36: istore 4
    //   38: getstatic 45	java/util/concurrent/TimeUnit:NANOSECONDS	Ljava/util/concurrent/TimeUnit;
    //   41: aload_0
    //   42: lload_1
    //   43: invokevirtual 84	java/util/concurrent/TimeUnit:timedJoin	(Ljava/lang/Thread;J)V
    //   46: iload 5
    //   48: ifeq +9 -> 57
    //   51: invokestatic 25	java/lang/Thread:currentThread	()Ljava/lang/Thread;
    //   54: invokevirtual 28	java/lang/Thread:interrupt	()V
    //   57: return
    //   58: astore_3
    //   59: iconst_1
    //   60: istore 4
    //   62: iconst_1
    //   63: istore 5
    //   65: invokestatic 41	java/lang/System:nanoTime	()J
    //   68: lstore_1
    //   69: lload 9
    //   71: lload 7
    //   73: ladd
    //   74: lload_1
    //   75: lsub
    //   76: lstore_1
    //   77: goto -43 -> 34
    //   80: astore_0
    //   81: iload 4
    //   83: ifeq +9 -> 92
    //   86: invokestatic 25	java/lang/Thread:currentThread	()Ljava/lang/Thread;
    //   89: invokevirtual 28	java/lang/Thread:interrupt	()V
    //   92: aload_0
    //   93: athrow
    // Local variable table:
    //   start	length	slot	name	signature
    //   0	94	0	paramThread	Thread
    //   0	94	1	paramLong	long
    //   0	94	3	paramTimeUnit	TimeUnit
    //   13	69	4	i	int
    //   9	55	5	j	int
    //   6	17	6	k	int
    //   20	52	7	l1	long
    //   29	41	9	l2	long
    // Exception table:
    //   from	to	target	type
    //   38	46	58	java/lang/InterruptedException
    //   15	22	80	finally
    //   26	31	80	finally
    //   38	46	80	finally
    //   65	69	80	finally
  }
  
  public static <E> void putUninterruptibly(BlockingQueue<E> paramBlockingQueue, E paramE)
  {
    int i = 0;
    try
    {
      paramBlockingQueue.put(paramE);
      if (i != 0) {
        Thread.currentThread().interrupt();
      }
      return;
    }
    catch (InterruptedException localInterruptedException)
    {
      for (;;)
      {
        localInterruptedException = localInterruptedException;
        i = 1;
      }
    }
    finally
    {
      paramBlockingQueue = finally;
      if (i != 0) {
        Thread.currentThread().interrupt();
      }
      throw paramBlockingQueue;
    }
  }
  
  /* Error */
  public static void sleepUninterruptibly(long paramLong, TimeUnit paramTimeUnit)
  {
    // Byte code:
    //   0: iconst_0
    //   1: istore 5
    //   3: iconst_0
    //   4: istore 4
    //   6: iload 5
    //   8: istore_3
    //   9: aload_2
    //   10: lload_0
    //   11: invokevirtual 35	java/util/concurrent/TimeUnit:toNanos	(J)J
    //   14: lstore 6
    //   16: iload 5
    //   18: istore_3
    //   19: invokestatic 41	java/lang/System:nanoTime	()J
    //   22: lstore 8
    //   24: lload 6
    //   26: lstore_0
    //   27: iload 4
    //   29: istore_3
    //   30: getstatic 45	java/util/concurrent/TimeUnit:NANOSECONDS	Ljava/util/concurrent/TimeUnit;
    //   33: lload_0
    //   34: invokevirtual 99	java/util/concurrent/TimeUnit:sleep	(J)V
    //   37: iload 4
    //   39: ifeq +9 -> 48
    //   42: invokestatic 25	java/lang/Thread:currentThread	()Ljava/lang/Thread;
    //   45: invokevirtual 28	java/lang/Thread:interrupt	()V
    //   48: return
    //   49: astore_2
    //   50: iconst_1
    //   51: istore_3
    //   52: iconst_1
    //   53: istore 4
    //   55: invokestatic 41	java/lang/System:nanoTime	()J
    //   58: lstore_0
    //   59: lload 8
    //   61: lload 6
    //   63: ladd
    //   64: lload_0
    //   65: lsub
    //   66: lstore_0
    //   67: goto -40 -> 27
    //   70: astore_2
    //   71: iload_3
    //   72: ifeq +9 -> 81
    //   75: invokestatic 25	java/lang/Thread:currentThread	()Ljava/lang/Thread;
    //   78: invokevirtual 28	java/lang/Thread:interrupt	()V
    //   81: aload_2
    //   82: athrow
    // Local variable table:
    //   start	length	slot	name	signature
    //   0	83	0	paramLong	long
    //   0	83	2	paramTimeUnit	TimeUnit
    //   8	64	3	i	int
    //   4	50	4	j	int
    //   1	16	5	k	int
    //   14	48	6	l1	long
    //   22	38	8	l2	long
    // Exception table:
    //   from	to	target	type
    //   30	37	49	java/lang/InterruptedException
    //   9	16	70	finally
    //   19	24	70	finally
    //   30	37	70	finally
    //   55	59	70	finally
  }
  
  public static <E> E takeUninterruptibly(BlockingQueue<E> paramBlockingQueue)
  {
    int i = 0;
    try
    {
      Object localObject = paramBlockingQueue.take();
      if (i != 0) {
        Thread.currentThread().interrupt();
      }
      return (E)localObject;
    }
    catch (InterruptedException localInterruptedException)
    {
      for (;;)
      {
        localInterruptedException = localInterruptedException;
        i = 1;
      }
    }
    finally
    {
      paramBlockingQueue = finally;
      if (i != 0) {
        Thread.currentThread().interrupt();
      }
      throw paramBlockingQueue;
    }
  }
  
  /* Error */
  public static boolean tryAcquireUninterruptibly(Semaphore paramSemaphore, int paramInt, long paramLong, TimeUnit paramTimeUnit)
  {
    // Byte code:
    //   0: iconst_0
    //   1: istore 7
    //   3: iconst_0
    //   4: istore 6
    //   6: iload 7
    //   8: istore 5
    //   10: aload 4
    //   12: lload_2
    //   13: invokevirtual 35	java/util/concurrent/TimeUnit:toNanos	(J)J
    //   16: lstore 8
    //   18: iload 7
    //   20: istore 5
    //   22: invokestatic 41	java/lang/System:nanoTime	()J
    //   25: lstore 10
    //   27: lload 8
    //   29: lstore_2
    //   30: iload 6
    //   32: istore 5
    //   34: aload_0
    //   35: iload_1
    //   36: lload_2
    //   37: getstatic 45	java/util/concurrent/TimeUnit:NANOSECONDS	Ljava/util/concurrent/TimeUnit;
    //   40: invokevirtual 113	java/util/concurrent/Semaphore:tryAcquire	(IJLjava/util/concurrent/TimeUnit;)Z
    //   43: istore 12
    //   45: iload 6
    //   47: ifeq +9 -> 56
    //   50: invokestatic 25	java/lang/Thread:currentThread	()Ljava/lang/Thread;
    //   53: invokevirtual 28	java/lang/Thread:interrupt	()V
    //   56: iload 12
    //   58: ireturn
    //   59: astore 4
    //   61: iconst_1
    //   62: istore 5
    //   64: iconst_1
    //   65: istore 6
    //   67: invokestatic 41	java/lang/System:nanoTime	()J
    //   70: lstore_2
    //   71: lload 10
    //   73: lload 8
    //   75: ladd
    //   76: lload_2
    //   77: lsub
    //   78: lstore_2
    //   79: goto -49 -> 30
    //   82: astore_0
    //   83: iload 5
    //   85: ifeq +9 -> 94
    //   88: invokestatic 25	java/lang/Thread:currentThread	()Ljava/lang/Thread;
    //   91: invokevirtual 28	java/lang/Thread:interrupt	()V
    //   94: aload_0
    //   95: athrow
    // Local variable table:
    //   start	length	slot	name	signature
    //   0	96	0	paramSemaphore	Semaphore
    //   0	96	1	paramInt	int
    //   0	96	2	paramLong	long
    //   0	96	4	paramTimeUnit	TimeUnit
    //   8	76	5	i	int
    //   4	62	6	j	int
    //   1	18	7	k	int
    //   16	58	8	l1	long
    //   25	47	10	l2	long
    //   43	14	12	bool	boolean
    // Exception table:
    //   from	to	target	type
    //   34	45	59	java/lang/InterruptedException
    //   10	18	82	finally
    //   22	27	82	finally
    //   34	45	82	finally
    //   67	71	82	finally
  }
  
  public static boolean tryAcquireUninterruptibly(Semaphore paramSemaphore, long paramLong, TimeUnit paramTimeUnit)
  {
    return tryAcquireUninterruptibly(paramSemaphore, 1, paramLong, paramTimeUnit);
  }
}


/* Location:              /home/merong/decompile/hackery-dex2jar.jar!/com/google/common/util/concurrent/Uninterruptibles.class
 * Java compiler version: 6 (50.0)
 * JD-Core Version:       0.7.1
 */