Skip to content

Conversation

@sgindeed
Copy link

@sgindeed sgindeed commented Oct 6, 2025

What does this PR do?

This PR fixes #2977
by improving BallThread to handle suspension, resumption, and termination safely. Changes include:

Thread-safe suspension/resumption using wait()/notifyAll().

Volatile flags isSuspended and isRunning ensure proper visibility.

Graceful termination with stopMe() and interruption handling.

Logging for suspend, resume, and interrupt events.

This ensures smooth animation control without deadlocks or busy-waiting

Fixes #2977

@github-actions
Copy link

github-actions bot commented Oct 6, 2025

Analyzing changes in this PR...

This might take a few minutes, please wait

📥 Commits

Analyzing changes from base (ede37bd) to latest commit (b9a89c0):

📁 Files being considered (1)

🔄 twin/src/main/java/com/iluwatar/twin/BallThread.java (1 hunk)


autogenerated by presubmit.ai

@sgindeed sgindeed closed this Oct 7, 2025
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.

Fix busy-waiting loops

1 participant