On 2010-11-04 16:22:27 -0400, Andrei Alexandrescu <[email protected]> said:

Oh, I see. Indeed, thread cleanup code should also go down the worklist and call destructors. By definition, no unshared objects should be visible by other threads.

Just a silly question... which thread will own immutable objects? And how does the GC knows we've cast an object to immutable? Or what happens if we just have one immutable member in the middle of a thread-local struct? Immutable implicitly means shared, so you can leak references to immutable members at will.

The same problem arise if you have a shared member as a member your struct or class.

--
Michel Fortin
[email protected]
http://michelf.com/

Reply via email to