1976 * been cleared, if the given object is another WeakClassKey
1977 * instance with the identical non-null referent as this one.
1978 */
1979 @Override
1980 public boolean equals(Object obj) {
1981 if (obj == this)
1982 return true;
1983
1984 if (obj instanceof WeakClassKey) {
1985 Object referent = get();
1986 return (referent != null) &&
1987 (referent == ((WeakClassKey) obj).get());
1988 } else {
1989 return false;
1990 }
1991 }
1992 }
1993
1994
1995 // The following three initially uninitialized fields are exclusively
1996 // managed by class java.util.concurrent.ThreadLocalRandom.
1997 /** The current seed for a ThreadLocalRandom */
1998 long threadLocalRandomSeed;
1999 /** Probe hash value; nonzero if threadLocalRandomSeed initialized */
2000 int threadLocalRandomProbe;
2001 /** Secondary seed isolated from public ThreadLocalRandom sequence */
2002 int threadLocalRandomSecondarySeed;
2003
2004 /* Some private helper methods */
2005 private native void setPriority0(int newPriority);
2006 private native void stop0(Object o);
2007 private native void suspend0();
2008 private native void resume0();
2009 private native void interrupt0();
2010 private native void setNativeName(String name);
2011 }
|
1976 * been cleared, if the given object is another WeakClassKey
1977 * instance with the identical non-null referent as this one.
1978 */
1979 @Override
1980 public boolean equals(Object obj) {
1981 if (obj == this)
1982 return true;
1983
1984 if (obj instanceof WeakClassKey) {
1985 Object referent = get();
1986 return (referent != null) &&
1987 (referent == ((WeakClassKey) obj).get());
1988 } else {
1989 return false;
1990 }
1991 }
1992 }
1993
1994
1995 // The following three initially uninitialized fields are exclusively
1996 // managed by class java.util.concurrent.ThreadLocalRandom. These
1997 // fields are used to build the high-performance PRNGs in the
1998 // concurrent code, and we can not risk accidental false sharing.
1999 // Hence, the fields are isolated with @Contended.
2000
2001 /** The current seed for a ThreadLocalRandom */
2002 @sun.misc.Contended("tlr")
2003 long threadLocalRandomSeed;
2004
2005 /** Probe hash value; nonzero if threadLocalRandomSeed initialized */
2006 @sun.misc.Contended("tlr")
2007 int threadLocalRandomProbe;
2008
2009 /** Secondary seed isolated from public ThreadLocalRandom sequence */
2010 @sun.misc.Contended("tlr")
2011 int threadLocalRandomSecondarySeed;
2012
2013 /* Some private helper methods */
2014 private native void setPriority0(int newPriority);
2015 private native void stop0(Object o);
2016 private native void suspend0();
2017 private native void resume0();
2018 private native void interrupt0();
2019 private native void setNativeName(String name);
2020 }
|