On 1/2/18 3:07 PM, jmh530 wrote:
On Tuesday, 2 January 2018 at 17:16:54 UTC, Steven Schveighoffer wrote:

It does something different depending on the type:

Objects: calls rt_finalize on the object, which calls the dtor, deletes the monitor, rewrites the init value to the object, and THEN zeroes the vtable ptr. This last step makes it inoperable for anyone still holding a pointer to the object. This is why I think the docs are written the way they are.


What's the monitor do? I see that in the ABI documentation, but it doesn't really explain it...

The monitor is used to lock any object for synchronization.

It's allocated on demand.

https://dlang.org/spec/class.html#synchronized-classes

-Steve

Reply via email to