On Friday, 10 July 2020 at 17:35:56 UTC, Steven Schveighoffer wrote:
Mark your setTime as shared, then cast away shared (as you don't need atomics once it's locked), and assign:

synchronized setTime(ref SysTime t) shared {
    (cast()this).time = t;
}

I know I can make it work by casting, my question is:

we had a lock on the owning shared object already, WHY we still need the cast to make it compile.

Reply via email to