Skip to content

Extraneous "lock" #3664

@seishun

Description

@seishun
  • I have searched open and closed issues and pull requests for duplicates, using these search terms:
    • lock counter
  • I have checked the latest main branch to see if this has already been fixed, in this file:
    • src/ch16-03-shared-state.md

URL to the section(s) of the book with this problem:
https://doc.rust-lang.org/stable/book/ch16-03-shared-state.html#sharing-a-mutext-between-multiple-threads

Description of the problem:

The error message states that the counter value was moved in the previous iteration of the loop. Rust is telling us that we can’t move the ownership of lock counter into multiple threads.

Suggested fix:

Drop the "lock".

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions