I want to use aspect-like annotations to transform

  @Lockable
  class Abc
  {
      @sync
      void f() {
          writeln("f");
      }

      @shared
      void g() {
          writeln("g");
      }
  }

to something like:

  class Abc
  {
      shared(ReadWriteMutex) _lock123;

      this()
      {
          _lock123 = cast(shared)(new ReadWriteMutex());
      }

      void f() {
          synchronized((cast()_lock123).writer) {
              writeln("f");
          }
      }

      void g() {
          synchronized((cast()_lock123).reader) {
              writeln("g");
          }
      }
  }

How can I do that?

Reply via email to