mq.java 2.36 KB
import java.security.AccessController;
import java.security.PrivilegedActionException;
import java.security.PrivilegedExceptionAction;
import java.util.Random;
import sun.misc.Unsafe;

abstract class mq
  extends Number
{
  static final ThreadLocal<int[]> a = new ThreadLocal();
  static final Random b = new Random();
  static final int c = Runtime.getRuntime().availableProcessors();
  private static final Unsafe g;
  private static final long h;
  private static final long i;
  volatile transient mq.a[] d;
  volatile transient long e;
  volatile transient int f;
  
  static
  {
    try
    {
      g = a();
      h = g.objectFieldOffset(mq.class.getDeclaredField("base"));
      i = g.objectFieldOffset(mq.class.getDeclaredField("busy"));
      return;
    }
    catch (Exception localException)
    {
      throw new Error(localException);
    }
  }
  
  private static Unsafe a()
  {
    try
    {
      Unsafe localUnsafe1 = Unsafe.getUnsafe();
      return localUnsafe1;
    }
    catch (SecurityException localSecurityException)
    {
      try
      {
        Unsafe localUnsafe2 = (Unsafe)AccessController.doPrivileged(new PrivilegedExceptionAction() {});
        return localUnsafe2;
      }
      catch (PrivilegedActionException localPrivilegedActionException)
      {
        throw new RuntimeException("Could not initialize intrinsics", localPrivilegedActionException.getCause());
      }
    }
  }
  
  abstract long a(long paramLong1, long paramLong2);
  
  final boolean b(long paramLong1, long paramLong2)
  {
    return g.compareAndSwapLong(this, h, paramLong1, paramLong2);
  }
  
  final boolean c()
  {
    return g.compareAndSwapInt(this, i, 0, 1);
  }
  
  static final class a
  {
    private static final Unsafe b;
    private static final long c;
    volatile long a;
    
    static
    {
      try
      {
        b = mq.d();
        c = b.objectFieldOffset(a.class.getDeclaredField("value"));
        return;
      }
      catch (Exception localException)
      {
        throw new Error(localException);
      }
    }
    
    a(long paramLong)
    {
      this.a = paramLong;
    }
    
    final boolean a(long paramLong1, long paramLong2)
    {
      return b.compareAndSwapLong(this, c, paramLong1, paramLong2);
    }
  }
}


/* Location:              /home/merong/decompile/hackery-dex2jar.jar!/mq.class
 * Java compiler version: 6 (50.0)
 * JD-Core Version:       0.7.1
 */