XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major Major
    • 5.0.3
    • 5.0.2
    • Documentation, STM
    • None

      The following code snippet is from the 5.0.2 STM Guide.

      public class ExampleInteger implements Atomic
      {   
         @WriteLock
         public int get () throws Exception
         {
             return state;
         }
      
         ...
      
         @ReadLock
         public void incr (int value) throws Exception
         {
             state += value;
         }
      
         private int state;
      }
      

      The lock annotations on incr and get need to be swapped in order for the example to be correct.

      A pull request is available.

              jonas.kongslund Jonas Kongslund (Inactive)
              jonas.kongslund Jonas Kongslund (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated:
                Resolved: