XMLWordPrintable

Details

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

    Description

      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.

      Attachments

        Activity

          People

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

            Dates

              Created:
              Updated:
              Resolved: