Skip to content

Extend Dictionary concurrent access detection to Remove() #26336

@danmoseley

Description

@danmoseley

#20569 added a change to turn hangs in Dictionary (caused by illegal concurrent access) into crashes, which are more useful.

It looks we missing the same protection in the 2 Remove() overloads. It contains code like

                while (i >= 0)
                {
                    ref Entry entry = ref entries[i];
...
                    i = entry.next;
                }

The hangs we have seen were all loops in the entries chain - such a loop could cause the above code to hang also so we should probably apply the same change to this.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions