> My memories tell me that I was never able to make a _thread safe_ weak > reference, though. I don't remember exactly, but I think that it was > because the dispose event happens after all threads have already > restarted. This means that some thread could extract a strong reference > from the weak reference before the weak reference knows that the > underlying object has been destroyed, thus creating a dangling pointer. > You are right, it is not thread safe. Some hook would be needed that gets called before threads are resumed. It is not an issue for std.signals2 because it is not meant to be thread safe.
Best regards, Robert