Skip to content

Fix thread safety in DataQueue using synchronized add() and poll()#19260

Open
simpanda01 wants to merge 1 commit into
eugenp:masterfrom
simpanda01:fix/dataqueue-thread-safety
Open

Fix thread safety in DataQueue using synchronized add() and poll()#19260
simpanda01 wants to merge 1 commit into
eugenp:masterfrom
simpanda01:fix/dataqueue-thread-safety

Conversation

@simpanda01

Copy link
Copy Markdown

Fixes #16156

Problem

The add() and poll() methods in DataQueue were not synchronized,
causing potential race conditions when multiple threads accessed
the queue concurrently.

Fix

Added synchronized keyword to both add() and poll() methods
to ensure thread-safe access to the underlying LinkedList queue.

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.

Thread Safety Issue in DataQueue add() and poll() Methods

2 participants