Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Copying Map #10

Merged
merged 1 commit into from
May 31, 2022
Merged

Copying Map #10

merged 1 commit into from
May 31, 2022

Conversation

madflojo
Copy link
Owner

Description

Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. List any dependencies that are required for this change.

This change will create a copy of the task map and return it to users rather than returning the task map directly. Since maps in Go are essentially pointers, if a user is iterating over the returned map while it's being written to (scheduling, deleting, etc.) then there is a possibility of a race condition.

This change will prevent that by returning a copy of the map.

Fixes # (issue)

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)

Checklist:

  • I have performed a self-review of my own code
  • I have commented my code, ensuring GoDoc readability and clarity in hard-to-understand areas
  • I have made corresponding changes to documentation
  • I have added tests that ensure my fix is effective or that my feature works
  • Any dependent changes have been merged and published in downstream modules

If checklist items are unchecked please explain.

@madflojo madflojo merged commit 0459763 into main May 31, 2022
@madflojo madflojo deleted the stop-del-race branch May 31, 2022 14:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant