Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@KaustubhOG
Copy link

Closes #2268

Fixes ownership issue in send_tx where the Queue struct was moved
into the first thread closure, preventing the second thread from accessing it.

Changes:

  • Destructured Queue into first_half and second_half
  • Cloned mpsc::Sender so both threads can send messages concurrently

All tests pass locally:

rustc --test exercises/20_threads/threads3.rs && ./threads3

=> test result: ok. 1 passed; 0 failed

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.

thread3.rs don't compile manually

1 participant