Class Lock


  • public class Lock
    extends java.lang.Object
    Class used with the synchronize keyword, representing a lock to avoid concurrent access. Here's a sample:
     Lock lock1 = new Lock(); // usually a class' field
     
     synchronized (lock1)
     {
        ...
     }
     
    Only a Lock object can be used with synchronize. Using this will abort the tc.Deploy and using other objects will cause a RuntimeException during code execution under the TCVM.
    Since:
    TotalCross 1.2
    • Constructor Summary

      Constructors 
      Constructor Description
      Lock()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected void finalize()  
      • Methods inherited from class java.lang.Object

        clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • Lock

        public Lock()
    • Method Detail

      • finalize

        protected void finalize()
        Overrides:
        finalize in class java.lang.Object