Thanks for the information. At least I've discovered a reasonably tidy way of wrapping Mutex up so that it's not quite as painful casting everything:

shared class SharedMutex {
  private Mutex mutex;

  private @property Mutex unsharedMutex() {
    return cast(Mutex)mutex;
  }

  this() {
    mutex = cast(shared)new Mutex();
  }

  alias unsharedMutex this;
}

SharedMutex can just be used like a normal Mutex, which is pretty neat. `alias this` is awesome!

Reply via email to