The scheme introduced with D121058 did not work properly. There are
three reasons, two are fixed here:
- The thread ID scheme is not needed and can result in dangling pointers if the thread in charge is faster than another one interested in deletion. We now keep the entry until the last thread that wants to delete the entry makes it to the deletion point.
- The PostProcessingPtrs set can contain an entry multiple times. The deletion can happen before we visit the entry again in a subsequent iteration. That resulted again in a dangling pointer. We track the deleted entries now to avoid this.
Each target task instead of thread.