Beispiel #1
0
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
//ORIGINAL LINE: private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException
        private void ReadObject(ObjectInputStream @in)
        {
            // Don't call defaultReadObject()
            ObjectInputStream.GetField oisFields = @in.ReadFields();
//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
//ORIGINAL LINE: final String oisHostname = (String)oisFields.get("hostname", null);
            String oisHostname = (String)oisFields.Get("hostname", null);
//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
//ORIGINAL LINE: final InetAddress oisAddr = (InetAddress)oisFields.get("addr", null);
            InetAddress oisAddr = (InetAddress)oisFields.Get("addr", null);
//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
//ORIGINAL LINE: final int oisPort = oisFields.get("port", -1);
            int oisPort = oisFields.Get("port", -1);

            // Check that our invariants are satisfied
            CheckPort(oisPort);
            if (oisHostname == null && oisAddr == null)
            {
                throw new InvalidObjectException("hostname and addr " + "can't both be null");
            }

            InetSocketAddressHolder h = new InetSocketAddressHolder(oisHostname, oisAddr, oisPort);

            UNSAFE.putObject(this, FIELDS_OFFSET, h);
        }
Beispiel #2
0
 private static void SetBlocker(Thread t, Object arg)
 {
     // Even though volatile, hotspot doesn't need a write barrier here.
     UNSAFE.putObject(t, ParkBlockerOffset, arg);
 }
Beispiel #3
0
 /// <summary>
 /// Constructs a new node.  Uses relaxed write because item can
 /// only be seen after publication via casNext.
 /// </summary>
 internal Node(E item)
 {
     UNSAFE.putObject(this, ItemOffset, item);
 }