digitalmars.D.learn - Shared value types can not be destructed
- Benjamin Thaut (15/15) Nov 13 2012 Apperently this is by design:
- Benjamin Thaut (2/17) Nov 14 2012 anyone?
Apperently this is by design: http://d.puremagic.com/issues/show_bug.cgi?id=8295 To clarify: It is not possible to define a destructor that will be called on the destruction of a shared struct. In a different thread Walter commeted this bug with: "If you include an object designed to work only in a single thread (non-shared), make it shared, and then destruct it when other threads may be pointing to it ... What should happen?" I did try to think of a case where his scenario would actually break something, but couldn't find one. If someone has more knowdelge about this situation some clarification would be great. Maybe even a small code sample that illustrates the problem. Kind Regards Benjamin Thaut
Nov 13 2012
Am 13.11.2012 17:25, schrieb Benjamin Thaut:Apperently this is by design: http://d.puremagic.com/issues/show_bug.cgi?id=8295 To clarify: It is not possible to define a destructor that will be called on the destruction of a shared struct. In a different thread Walter commeted this bug with: "If you include an object designed to work only in a single thread (non-shared), make it shared, and then destruct it when other threads may be pointing to it ... What should happen?" I did try to think of a case where his scenario would actually break something, but couldn't find one. If someone has more knowdelge about this situation some clarification would be great. Maybe even a small code sample that illustrates the problem. Kind Regards Benjamin Thautanyone?
Nov 14 2012