[Issue 15947] [REG 2.069.0?] simple multithreaded program + "-profile=gc" = crash

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Thu Apr 21 08:46:07 PDT 2016


https://issues.dlang.org/show_bug.cgi?id=15947

--- Comment #1 from Ivan Kazmenko <gassa at mail.ru> ---
Interestingly, a modified version does not crash:

-----prfail2.d-----
import std.concurrency;
void someWork () {auto x = [1];}
void main () {spawn (&someWork); someWork ();}
-----

I was curious if this guarantees that the spawned thread finishes before the
main thread, but the third example, also crashing, seems to contradict that:

-----prfail3.d-----
import std.concurrency;
void someWork () {auto x = [1];}
void main () {
    spawnLinked (&someWork);
    try {receive ((int) {});}
    catch (LinkTerminated o) {}
}
-----

--


More information about the Digitalmars-d-bugs mailing list