Monitor.java 21.2 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 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895
package com.google.common.util.concurrent;

import com.google.common.annotations.Beta;
import com.google.common.base.Preconditions;
import com.google.common.base.Throwables;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.locks.Condition;
import java.util.concurrent.locks.ReentrantLock;
import javax.annotation.concurrent.GuardedBy;

@Beta
public final class Monitor
{
  private final boolean a;
  private final ReentrantLock b;
  @GuardedBy("lock")
  private Guard c = null;
  
  public Monitor()
  {
    this(false);
  }
  
  public Monitor(boolean paramBoolean)
  {
    this.a = paramBoolean;
    this.b = new ReentrantLock(paramBoolean);
  }
  
  @GuardedBy("lock")
  private void a()
  {
    for (Guard localGuard = this.c;; localGuard = localGuard.e) {
      if (localGuard != null)
      {
        if (a(localGuard)) {
          localGuard.c.signal();
        }
      }
      else {
        return;
      }
    }
  }
  
  @GuardedBy("lock")
  private void a(Guard paramGuard, boolean paramBoolean)
    throws InterruptedException
  {
    if (paramBoolean) {
      a();
    }
    b(paramGuard);
    try
    {
      do
      {
        paramGuard.c.await();
        paramBoolean = paramGuard.isSatisfied();
      } while (!paramBoolean);
      return;
    }
    finally
    {
      c(paramGuard);
    }
  }
  
  @GuardedBy("lock")
  private boolean a(Guard paramGuard)
  {
    try
    {
      boolean bool = paramGuard.isSatisfied();
      return bool;
    }
    catch (Throwable localThrowable)
    {
      for (paramGuard = this.c; paramGuard != null; paramGuard = paramGuard.e) {
        paramGuard.c.signalAll();
      }
      throw Throwables.propagate(localThrowable);
    }
  }
  
  @GuardedBy("lock")
  private boolean a(Guard paramGuard, long paramLong, boolean paramBoolean)
    throws InterruptedException
  {
    if (paramBoolean) {
      a();
    }
    b(paramGuard);
    for (;;)
    {
      if (paramLong < 0L)
      {
        c(paramGuard);
        return false;
      }
      try
      {
        paramLong = paramGuard.c.awaitNanos(paramLong);
        paramBoolean = paramGuard.isSatisfied();
        if (!paramBoolean) {
          continue;
        }
        return true;
      }
      finally
      {
        c(paramGuard);
      }
    }
  }
  
  @GuardedBy("lock")
  private void b(Guard paramGuard)
  {
    int i = paramGuard.d;
    paramGuard.d = (i + 1);
    if (i == 0)
    {
      paramGuard.e = this.c;
      this.c = paramGuard;
    }
  }
  
  @GuardedBy("lock")
  private void b(Guard paramGuard, boolean paramBoolean)
  {
    if (paramBoolean) {
      a();
    }
    b(paramGuard);
    try
    {
      do
      {
        paramGuard.c.awaitUninterruptibly();
        paramBoolean = paramGuard.isSatisfied();
      } while (!paramBoolean);
      return;
    }
    finally
    {
      c(paramGuard);
    }
  }
  
  @GuardedBy("lock")
  private void c(Guard paramGuard)
  {
    int i = paramGuard.d - 1;
    paramGuard.d = i;
    Object localObject1;
    Object localObject2;
    if (i == 0)
    {
      localObject1 = this.c;
      localObject2 = null;
    }
    for (;;)
    {
      if (localObject1 == paramGuard)
      {
        if (localObject2 == null) {
          this.c = ((Guard)localObject1).e;
        }
        for (;;)
        {
          ((Guard)localObject1).e = null;
          return;
          ((Guard)localObject2).e = ((Guard)localObject1).e;
        }
      }
      Guard localGuard = ((Guard)localObject1).e;
      localObject2 = localObject1;
      localObject1 = localGuard;
    }
  }
  
  public final void enter()
  {
    this.b.lock();
  }
  
  public final boolean enter(long paramLong, TimeUnit paramTimeUnit)
  {
    boolean bool2 = true;
    long l1 = paramTimeUnit.toNanos(paramLong);
    paramTimeUnit = this.b;
    if ((!this.a) && (paramTimeUnit.tryLock())) {}
    for (;;)
    {
      return bool2;
      long l2 = System.nanoTime();
      bool1 = Thread.interrupted();
      paramLong = l1;
      try
      {
        boolean bool3 = paramTimeUnit.tryLock(paramLong, TimeUnit.NANOSECONDS);
        bool2 = bool3;
        if (bool1)
        {
          Thread.currentThread().interrupt();
          return bool3;
        }
      }
      catch (InterruptedException localInterruptedException)
      {
        localInterruptedException = localInterruptedException;
      }
      finally
      {
        try
        {
          for (;;)
          {
            paramLong = System.nanoTime();
            paramLong = l2 + l1 - paramLong;
            bool1 = true;
          }
        }
        finally
        {
          bool1 = true;
        }
        paramTimeUnit = finally;
      }
    }
    if (bool1) {
      Thread.currentThread().interrupt();
    }
    throw paramTimeUnit;
  }
  
  public final boolean enterIf(Guard paramGuard)
  {
    if (paramGuard.b != this) {
      throw new IllegalMonitorStateException();
    }
    ReentrantLock localReentrantLock = this.b;
    localReentrantLock.lock();
    try
    {
      boolean bool = paramGuard.isSatisfied();
      if (!bool) {}
      return bool;
    }
    finally
    {
      localReentrantLock.unlock();
    }
  }
  
  public final boolean enterIf(Guard paramGuard, long paramLong, TimeUnit paramTimeUnit)
  {
    if (paramGuard.b != this) {
      throw new IllegalMonitorStateException();
    }
    boolean bool1;
    if (!enter(paramLong, paramTimeUnit)) {
      bool1 = false;
    }
    for (;;)
    {
      return bool1;
      try
      {
        boolean bool2 = paramGuard.isSatisfied();
        bool1 = bool2;
        if (bool2) {
          continue;
        }
        return bool2;
      }
      finally
      {
        this.b.unlock();
      }
    }
  }
  
  public final boolean enterIfInterruptibly(Guard paramGuard)
    throws InterruptedException
  {
    if (paramGuard.b != this) {
      throw new IllegalMonitorStateException();
    }
    ReentrantLock localReentrantLock = this.b;
    localReentrantLock.lockInterruptibly();
    try
    {
      boolean bool = paramGuard.isSatisfied();
      if (!bool) {}
      return bool;
    }
    finally
    {
      localReentrantLock.unlock();
    }
  }
  
  public final boolean enterIfInterruptibly(Guard paramGuard, long paramLong, TimeUnit paramTimeUnit)
    throws InterruptedException
  {
    if (paramGuard.b != this) {
      throw new IllegalMonitorStateException();
    }
    ReentrantLock localReentrantLock = this.b;
    boolean bool1;
    if (!localReentrantLock.tryLock(paramLong, paramTimeUnit)) {
      bool1 = false;
    }
    for (;;)
    {
      return bool1;
      try
      {
        boolean bool2 = paramGuard.isSatisfied();
        bool1 = bool2;
        if (bool2) {
          continue;
        }
        return bool2;
      }
      finally
      {
        localReentrantLock.unlock();
      }
    }
  }
  
  public final void enterInterruptibly()
    throws InterruptedException
  {
    this.b.lockInterruptibly();
  }
  
  public final boolean enterInterruptibly(long paramLong, TimeUnit paramTimeUnit)
    throws InterruptedException
  {
    return this.b.tryLock(paramLong, paramTimeUnit);
  }
  
  public final void enterWhen(Guard paramGuard)
    throws InterruptedException
  {
    if (paramGuard.b != this) {
      throw new IllegalMonitorStateException();
    }
    ReentrantLock localReentrantLock = this.b;
    boolean bool = localReentrantLock.isHeldByCurrentThread();
    localReentrantLock.lockInterruptibly();
    try
    {
      if (!paramGuard.isSatisfied()) {
        a(paramGuard, bool);
      }
      return;
    }
    finally
    {
      leave();
    }
  }
  
  /* Error */
  public final boolean enterWhen(Guard paramGuard, long paramLong, TimeUnit paramTimeUnit)
    throws InterruptedException
  {
    // Byte code:
    //   0: aload 4
    //   2: lload_2
    //   3: invokevirtual 100	java/util/concurrent/TimeUnit:toNanos	(J)J
    //   6: lstore 7
    //   8: aload_1
    //   9: getfield 131	com/google/common/util/concurrent/Monitor$Guard:b	Lcom/google/common/util/concurrent/Monitor;
    //   12: aload_0
    //   13: if_acmpeq +11 -> 24
    //   16: new 133	java/lang/IllegalMonitorStateException
    //   19: dup
    //   20: invokespecial 134	java/lang/IllegalMonitorStateException:<init>	()V
    //   23: athrow
    //   24: aload_0
    //   25: getfield 34	com/google/common/util/concurrent/Monitor:b	Ljava/util/concurrent/locks/ReentrantLock;
    //   28: astore 11
    //   30: aload 11
    //   32: invokevirtual 149	java/util/concurrent/locks/ReentrantLock:isHeldByCurrentThread	()Z
    //   35: istore 9
    //   37: aload_0
    //   38: getfield 29	com/google/common/util/concurrent/Monitor:a	Z
    //   41: ifne +15 -> 56
    //   44: lload 7
    //   46: lstore 5
    //   48: aload 11
    //   50: invokevirtual 103	java/util/concurrent/locks/ReentrantLock:tryLock	()Z
    //   53: ifne +32 -> 85
    //   56: invokestatic 109	java/lang/System:nanoTime	()J
    //   59: lstore 5
    //   61: aload 11
    //   63: lload_2
    //   64: aload 4
    //   66: invokevirtual 120	java/util/concurrent/locks/ReentrantLock:tryLock	(JLjava/util/concurrent/TimeUnit;)Z
    //   69: ifne +5 -> 74
    //   72: iconst_0
    //   73: ireturn
    //   74: lload 7
    //   76: lload 5
    //   78: ladd
    //   79: invokestatic 109	java/lang/System:nanoTime	()J
    //   82: lsub
    //   83: lstore 5
    //   85: aload_1
    //   86: invokevirtual 65	com/google/common/util/concurrent/Monitor$Guard:isSatisfied	()Z
    //   89: ifne +19 -> 108
    //   92: aload_0
    //   93: aload_1
    //   94: lload 5
    //   96: iload 9
    //   98: invokespecial 156	com/google/common/util/concurrent/Monitor:a	(Lcom/google/common/util/concurrent/Monitor$Guard;JZ)Z
    //   101: istore 10
    //   103: iload 10
    //   105: ifeq +19 -> 124
    //   108: iconst_1
    //   109: istore 9
    //   111: iload 9
    //   113: ifne +8 -> 121
    //   116: aload 11
    //   118: invokevirtual 137	java/util/concurrent/locks/ReentrantLock:unlock	()V
    //   121: iload 9
    //   123: ireturn
    //   124: iconst_0
    //   125: istore 9
    //   127: goto -16 -> 111
    //   130: astore_1
    //   131: iload 9
    //   133: ifne +7 -> 140
    //   136: aload_0
    //   137: invokespecial 55	com/google/common/util/concurrent/Monitor:a	()V
    //   140: aload 11
    //   142: invokevirtual 137	java/util/concurrent/locks/ReentrantLock:unlock	()V
    //   145: aload_1
    //   146: athrow
    //   147: astore_1
    //   148: aload 11
    //   150: invokevirtual 137	java/util/concurrent/locks/ReentrantLock:unlock	()V
    //   153: aload_1
    //   154: athrow
    // Local variable table:
    //   start	length	slot	name	signature
    //   0	155	0	this	Monitor
    //   0	155	1	paramGuard	Guard
    //   0	155	2	paramLong	long
    //   0	155	4	paramTimeUnit	TimeUnit
    //   46	49	5	l1	long
    //   6	69	7	l2	long
    //   35	97	9	bool1	boolean
    //   101	3	10	bool2	boolean
    //   28	121	11	localReentrantLock	ReentrantLock
    // Exception table:
    //   from	to	target	type
    //   85	103	130	finally
    //   136	140	147	finally
  }
  
  public final void enterWhenUninterruptibly(Guard paramGuard)
  {
    if (paramGuard.b != this) {
      throw new IllegalMonitorStateException();
    }
    ReentrantLock localReentrantLock = this.b;
    boolean bool = localReentrantLock.isHeldByCurrentThread();
    localReentrantLock.lock();
    try
    {
      if (!paramGuard.isSatisfied()) {
        b(paramGuard, bool);
      }
      return;
    }
    finally
    {
      leave();
    }
  }
  
  public final boolean enterWhenUninterruptibly(Guard paramGuard, long paramLong, TimeUnit paramTimeUnit)
  {
    l1 = paramTimeUnit.toNanos(paramLong);
    if (paramGuard.b != this) {
      throw new IllegalMonitorStateException();
    }
    paramTimeUnit = this.b;
    long l2 = System.nanoTime() + l1;
    boolean bool4 = paramTimeUnit.isHeldByCurrentThread();
    boolean bool2 = Thread.interrupted();
    boolean bool1 = bool2;
    try
    {
      if (!this.a)
      {
        bool1 = bool2;
        bool3 = paramTimeUnit.tryLock();
        paramLong = l1;
        bool1 = bool2;
        if (bool3) {
          break label151;
        }
      }
      bool3 = false;
    }
    finally
    {
      for (;;)
      {
        boolean bool3;
        label125:
        label129:
        label151:
        label185:
        label228:
        continue;
        l1 = paramLong;
      }
    }
    bool1 = bool2;
    try
    {
      bool5 = paramTimeUnit.tryLock(l1, TimeUnit.NANOSECONDS);
      if (bool5) {
        break label125;
      }
      if (bool2) {
        Thread.currentThread().interrupt();
      }
      bool3 = false;
    }
    catch (InterruptedException localInterruptedException1)
    {
      try
      {
        boolean bool5;
        if (paramGuard.isSatisfied()) {
          break label185;
        }
        bool2 = bool1;
        bool3 = a(paramGuard, paramLong, bool3);
        if (!bool3) {
          break label228;
        }
        for (bool2 = true;; bool2 = false)
        {
          if (!bool2) {
            bool3 = bool1;
          }
          try
          {
            paramTimeUnit.unlock();
            bool3 = bool2;
            if (!bool1) {
              break;
            }
            Thread.currentThread().interrupt();
            return bool2;
          }
          finally
          {
            bool1 = bool3;
          }
          localInterruptedException1 = localInterruptedException1;
          bool2 = true;
          break label129;
        }
      }
      catch (InterruptedException localInterruptedException2)
      {
        for (;;)
        {
          bool2 = true;
          bool1 = true;
          bool3 = false;
          paramLong = System.nanoTime();
          paramLong = l2 - paramLong;
        }
      }
      finally
      {
        bool3 = bool2;
        paramTimeUnit.unlock();
        bool3 = bool2;
      }
    }
    return bool3;
    bool3 = bool5;
    bool1 = bool2;
    paramLong = System.nanoTime();
    paramLong = l2 - paramLong;
    if (bool3)
    {
      bool1 = bool2;
      bool3 = bool4;
      bool2 = bool1;
      if (bool1) {
        Thread.currentThread().interrupt();
      }
      throw paramGuard;
    }
  }
  
  public final int getOccupiedDepth()
  {
    return this.b.getHoldCount();
  }
  
  public final int getQueueLength()
  {
    return this.b.getQueueLength();
  }
  
  public final int getWaitQueueLength(Guard paramGuard)
  {
    if (paramGuard.b != this) {
      throw new IllegalMonitorStateException();
    }
    this.b.lock();
    try
    {
      int i = paramGuard.d;
      return i;
    }
    finally
    {
      this.b.unlock();
    }
  }
  
  public final boolean hasQueuedThread(Thread paramThread)
  {
    return this.b.hasQueuedThread(paramThread);
  }
  
  public final boolean hasQueuedThreads()
  {
    return this.b.hasQueuedThreads();
  }
  
  public final boolean hasWaiters(Guard paramGuard)
  {
    return getWaitQueueLength(paramGuard) > 0;
  }
  
  public final boolean isFair()
  {
    return this.a;
  }
  
  public final boolean isOccupied()
  {
    return this.b.isLocked();
  }
  
  public final boolean isOccupiedByCurrentThread()
  {
    return this.b.isHeldByCurrentThread();
  }
  
  public final void leave()
  {
    ReentrantLock localReentrantLock = this.b;
    try
    {
      if (localReentrantLock.getHoldCount() == 1) {
        a();
      }
      return;
    }
    finally
    {
      localReentrantLock.unlock();
    }
  }
  
  public final boolean tryEnter()
  {
    return this.b.tryLock();
  }
  
  public final boolean tryEnterIf(Guard paramGuard)
  {
    if (paramGuard.b != this) {
      throw new IllegalMonitorStateException();
    }
    ReentrantLock localReentrantLock = this.b;
    boolean bool1;
    if (!localReentrantLock.tryLock()) {
      bool1 = false;
    }
    for (;;)
    {
      return bool1;
      try
      {
        boolean bool2 = paramGuard.isSatisfied();
        bool1 = bool2;
        if (bool2) {
          continue;
        }
        return bool2;
      }
      finally
      {
        localReentrantLock.unlock();
      }
    }
  }
  
  public final void waitFor(Guard paramGuard)
    throws InterruptedException
  {
    if (paramGuard.b == this) {}
    for (int i = 1; (i & this.b.isHeldByCurrentThread()) == 0; i = 0) {
      throw new IllegalMonitorStateException();
    }
    if (!paramGuard.isSatisfied()) {
      a(paramGuard, true);
    }
  }
  
  public final boolean waitFor(Guard paramGuard, long paramLong, TimeUnit paramTimeUnit)
    throws InterruptedException
  {
    boolean bool = false;
    paramLong = paramTimeUnit.toNanos(paramLong);
    if (paramGuard.b == this) {}
    for (int i = 1; (i & this.b.isHeldByCurrentThread()) == 0; i = 0) {
      throw new IllegalMonitorStateException();
    }
    if ((paramGuard.isSatisfied()) || (a(paramGuard, paramLong, true))) {
      bool = true;
    }
    return bool;
  }
  
  public final void waitForUninterruptibly(Guard paramGuard)
  {
    if (paramGuard.b == this) {}
    for (int i = 1; (i & this.b.isHeldByCurrentThread()) == 0; i = 0) {
      throw new IllegalMonitorStateException();
    }
    if (!paramGuard.isSatisfied()) {
      b(paramGuard, true);
    }
  }
  
  /* Error */
  public final boolean waitForUninterruptibly(Guard paramGuard, long paramLong, TimeUnit paramTimeUnit)
  {
    // Byte code:
    //   0: iconst_1
    //   1: istore 12
    //   3: iconst_1
    //   4: istore 11
    //   6: aload 4
    //   8: lload_2
    //   9: invokevirtual 100	java/util/concurrent/TimeUnit:toNanos	(J)J
    //   12: lstore 6
    //   14: aload_1
    //   15: getfield 131	com/google/common/util/concurrent/Monitor$Guard:b	Lcom/google/common/util/concurrent/Monitor;
    //   18: aload_0
    //   19: if_acmpne +27 -> 46
    //   22: iconst_1
    //   23: istore 5
    //   25: iload 5
    //   27: aload_0
    //   28: getfield 34	com/google/common/util/concurrent/Monitor:b	Ljava/util/concurrent/locks/ReentrantLock;
    //   31: invokevirtual 149	java/util/concurrent/locks/ReentrantLock:isHeldByCurrentThread	()Z
    //   34: iand
    //   35: ifne +17 -> 52
    //   38: new 133	java/lang/IllegalMonitorStateException
    //   41: dup
    //   42: invokespecial 134	java/lang/IllegalMonitorStateException:<init>	()V
    //   45: athrow
    //   46: iconst_0
    //   47: istore 5
    //   49: goto -24 -> 25
    //   52: aload_1
    //   53: invokevirtual 65	com/google/common/util/concurrent/Monitor$Guard:isSatisfied	()Z
    //   56: ifeq +6 -> 62
    //   59: iload 11
    //   61: ireturn
    //   62: invokestatic 109	java/lang/System:nanoTime	()J
    //   65: lstore 8
    //   67: invokestatic 114	java/lang/Thread:interrupted	()Z
    //   70: istore 10
    //   72: iconst_1
    //   73: istore 11
    //   75: lload 6
    //   77: lstore_2
    //   78: aload_0
    //   79: aload_1
    //   80: lload_2
    //   81: iload 11
    //   83: invokespecial 156	com/google/common/util/concurrent/Monitor:a	(Lcom/google/common/util/concurrent/Monitor$Guard;JZ)Z
    //   86: istore 11
    //   88: iload 11
    //   90: istore 12
    //   92: iload 12
    //   94: istore 11
    //   96: iload 10
    //   98: ifeq -39 -> 59
    //   101: invokestatic 124	java/lang/Thread:currentThread	()Ljava/lang/Thread;
    //   104: invokevirtual 127	java/lang/Thread:interrupt	()V
    //   107: iload 12
    //   109: ireturn
    //   110: astore 4
    //   112: aload_1
    //   113: invokevirtual 65	com/google/common/util/concurrent/Monitor$Guard:isSatisfied	()Z
    //   116: istore 10
    //   118: iload 10
    //   120: ifeq +11 -> 131
    //   123: invokestatic 124	java/lang/Thread:currentThread	()Ljava/lang/Thread;
    //   126: invokevirtual 127	java/lang/Thread:interrupt	()V
    //   129: iconst_1
    //   130: ireturn
    //   131: invokestatic 109	java/lang/System:nanoTime	()J
    //   134: lstore_2
    //   135: lload 8
    //   137: lload 6
    //   139: ladd
    //   140: lload_2
    //   141: lsub
    //   142: lstore_2
    //   143: iconst_1
    //   144: istore 10
    //   146: iconst_0
    //   147: istore 11
    //   149: goto -71 -> 78
    //   152: astore_1
    //   153: iload 10
    //   155: ifeq +9 -> 164
    //   158: invokestatic 124	java/lang/Thread:currentThread	()Ljava/lang/Thread;
    //   161: invokevirtual 127	java/lang/Thread:interrupt	()V
    //   164: aload_1
    //   165: athrow
    //   166: astore_1
    //   167: iload 12
    //   169: istore 10
    //   171: goto -18 -> 153
    // Local variable table:
    //   start	length	slot	name	signature
    //   0	174	0	this	Monitor
    //   0	174	1	paramGuard	Guard
    //   0	174	2	paramLong	long
    //   0	174	4	paramTimeUnit	TimeUnit
    //   23	25	5	i	int
    //   12	126	6	l1	long
    //   65	71	8	l2	long
    //   70	100	10	bool1	boolean
    //   4	144	11	bool2	boolean
    //   1	167	12	bool3	boolean
    // Exception table:
    //   from	to	target	type
    //   78	88	110	java/lang/InterruptedException
    //   78	88	152	finally
    //   112	118	166	finally
    //   131	135	166	finally
  }
  
  @Beta
  public static abstract class Guard
  {
    final Monitor b;
    final Condition c;
    @GuardedBy("monitor.lock")
    int d = 0;
    @GuardedBy("monitor.lock")
    Guard e;
    
    protected Guard(Monitor paramMonitor)
    {
      this.b = ((Monitor)Preconditions.checkNotNull(paramMonitor, "monitor"));
      this.c = Monitor.a(paramMonitor).newCondition();
    }
    
    public abstract boolean isSatisfied();
  }
}


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