Skip to content

It is not possible to use Items() race-free if a janitor is running #36

@lmb

Description

@lmb

Since the lock on the map is released once Items() returns, the janitor can come along and concurrently modify the map while user code is accessing it. Adding a wrapper of synchronisation as suggested by the documentation is useless.

The solution is to explicitly copy the map and return the copy.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions