`std.signal` implementation is written like it is called from a single thread or explicitly synchronized. The reality is on objects collecting GC calls dispose events of finalizing object from its thread. So `unhook` can be called in a middle of `emit`, `connect`, or `disconnect` freezed in other thread.
As we can't lock GC (at least in `emit`) some sort of lock-free programming should be used here.
A think-less fix just to prevent nasty random failures: https://github.com/D-Programming-Language/phobos/pull/1179
Added issue 4151 as a dependency as weak reference looks as the right way to fix this.
THIS ISSUE HAS BEEN MOVED TO GITHUB https://github.com/dlang/phobos/issues/9956 DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB