Created by: Carrotman42
In environments where there are a lot of signals being delivered to threads of a process, there is possibly a race where one thread links/unlinks while another is waiting to do it themselves. With this commit, we have threads skip linking/unlinking if they notice another thread did this (after they have obtained the change_linking_lock).
This fixes an ASSERT I'm hitting with an app: https://github.com/DynamoRIO/dynamorio/blob/9d9129a/core/link.c#L1896
Issue #2066 (closed)