std.concurrency : sending immutable classes

Dicebot public at dicebot.lv
Mon Nov 11 15:31:42 PST 2013


On Monday, 11 November 2013 at 23:21:14 UTC, Joseph Rushton 
Wakeling wrote:
> (the message for which won't be printed if it's thrown in the 
> thread).

Whoa, didn't know that, I thought it will terminate the thread 
and cause related exception in owner thread. I have just checked 
it an yeah, assertion error is thrown:

core.exception.AssertError@/usr/include/dlang/dmd/std/variant.d(287): 
immutable(A)
----------------
/tmp/.rdmd-1000/rdmd-test.d-076D4362D54E9EAA8F49CE8F8A45511D/test(_d_assert_msg+0x45) 
[0x462d9d]
/tmp/.rdmd-1000/rdmd-test.d-076D4362D54E9EAA8F49CE8F8A45511D/test(bool 
std.variant.VariantN!(32uL).VariantN.handler!(immutable(test.A)).handler(std.variant.VariantN!(32uL).VariantN.OpID, 
ubyte[32]*, void*).tryPutting(immutable(test.A)*, TypeInfo, 
void*)+0x8d) [0x461665]
/tmp/.rdmd-1000/rdmd-test.d-076D4362D54E9EAA8F49CE8F8A45511D/test(@trusted 
long 
std.variant.VariantN!(32uL).VariantN.handler!(immutable(test.A)).handler(std.variant.VariantN!(32uL).VariantN.OpID, 
ubyte[32]*, void*)+0xc3) [0x461393]
/tmp/.rdmd-1000/rdmd-test.d-076D4362D54E9EAA8F49CE8F8A45511D/test(@property 
@trusted immutable(test.A) 
std.variant.VariantN!(32uL).VariantN.get!(immutable(test.A)).get()+0x68) 
[0x45ee28]
/tmp/.rdmd-1000/rdmd-test.d-076D4362D54E9EAA8F49CE8F8A45511D/test(void 
std.concurrency.Message.map!(void 
function(immutable(test.A))*).map(void 
function(immutable(test.A))*)+0x5a) [0x45edb2]
/tmp/.rdmd-1000/rdmd-test.d-076D4362D54E9EAA8F49CE8F8A45511D/test(bool 
std.concurrency.MessageBox.get!(void 
function(immutable(test.A))*, void 
function(std.variant.VariantN!(32uL).VariantN)*).get(scope void 
function(immutable(test.A))*, scope void 
function(std.variant.VariantN!(32uL).VariantN)*).bool 
onStandardMsg(ref std.concurrency.Message)+0x31) [0x45e7a9]
/tmp/.rdmd-1000/rdmd-test.d-076D4362D54E9EAA8F49CE8F8A45511D/test(bool 
std.concurrency.MessageBox.get!(void 
function(immutable(test.A))*, void 
function(std.variant.VariantN!(32uL).VariantN)*).get(scope void 
function(immutable(test.A))*, scope void 
function(std.variant.VariantN!(32uL).VariantN)*).bool scan(ref 
std.concurrency.List!(std.concurrency.Message).List)+0xe6) 
[0x45eb06]
/tmp/.rdmd-1000/rdmd-test.d-076D4362D54E9EAA8F49CE8F8A45511D/test(bool 
std.concurrency.MessageBox.get!(void 
function(immutable(test.A))*, void 
function(std.variant.VariantN!(32uL).VariantN)*).get(scope void 
function(immutable(test.A))*, scope void 
function(std.variant.VariantN!(32uL).VariantN)*)+0x17f) [0x45e6e7]
/tmp/.rdmd-1000/rdmd-test.d-076D4362D54E9EAA8F49CE8F8A45511D/test(void 
std.concurrency.receive!(void function(immutable(test.A))*, void 
function(std.variant.VariantN!(32uL).VariantN)*).receive(void 
function(immutable(test.A))*, void 
function(std.variant.VariantN!(32uL).VariantN)*)+0x83) [0x45e553]
/tmp/.rdmd-1000/rdmd-test.d-076D4362D54E9EAA8F49CE8F8A45511D/test(void 
test.thread()+0x2a) [0x45b782]
/tmp/.rdmd-1000/rdmd-test.d-076D4362D54E9EAA8F49CE8F8A45511D/test(_D3std11concurrency16__T6_spawnTPFZvZ6_spawnFbPFZvZS3std11concurrency3Tid4execMFZv+0x42) 
[0x46116a]
/tmp/.rdmd-1000/rdmd-test.d-076D4362D54E9EAA8F49CE8F8A45511D/test(void 
core.thread.Thread.run()+0x2a) [0x47c9da]
/tmp/.rdmd-1000/rdmd-test.d-076D4362D54E9EAA8F49CE8F8A45511D/test(thread_entryPoint+0x165) 
[0x47c761]


More information about the Digitalmars-d-learn mailing list