std.signals2 proposal

eskimo jfanatiker at gmx.at
Tue Nov 6 14:53:46 PST 2012


> What happens when a callback removes itself from the signal when called?  What happens when it adds a new callback?  Since these operations modify the list that's currently being iterated across, the implementation typically has to be done in a way that accounts for this.

Damn it. That's why the check for null was there. Thank you! So in the
old implementation it would simply miss to call a slot in the list on
removal, in the new implementation it would crash currently. (Because of
the removed check) But also the original behavior is not really
acceptable. Also this means that: 

 slots[slots_idx] = null;        // not strictly necessary

in the original implementation was not as effectless as it seemed.

Thanks for this very good hint, I will improve it in this regard! 



More information about the Digitalmars-d mailing list