vein icon indicating copy to clipboard operation
vein copied to clipboard

Sync-method syntax support

Open 0xF6 opened this issue 3 years ago • 0 comments

  • [x] Proposed
  • [ ] Triage: Completed
  • [ ] Prototype: not started
  • [ ] Implementation: not started
  • [ ] Specification: not started

define sync in method declaration

public class Foo
{
   public sync fn(): void 
   { } 
}

Ishtar view (transformation result)


// non-static variant
public class Foo
{
   public fn(): void 
   { 
        Synchronicity.For(this);
        try
        {
            // ...
        }
        finally
        {
            Synchronicity.Release(this);
        }
   } 
}
// static variant
public static class Foo
{
   private static guarder: Object = new Object();
   public static fn(): void 
   { 
        Synchronicity.For(guarder);
        try
        { 
            // ...
        }
        finally
        {
            Synchronicity.Release(guarder);
        }
   } 
}

0xF6 avatar May 24 '21 22:05 0xF6