Some code I find suprising.
fork{
var t = thisThread;
t.exceptionHandler = { "A".postln };
fork {
(thisThread.parent == t).postln; // false
(thisThread.parent == thisProcess.mainThread).postln; // true
}
}
From docs
.parent
The parent Thread that started or resumed this Thread.
So I understand what is going on here, the main thread starts it back up because that is what resumes it… but I still expect the parent thread above to be t.
Whats is really bothering me is that that nested thread doesn’t inherit the exception handler from t.
This would allow you to write try { ... } and it work even if the ... spawned another thread that threw.