Skip to content

Conversation

@pguyot
Copy link
Collaborator

@pguyot pguyot commented Dec 19, 2025

Ensure listeners_poll_count and select_events_poll_count are only updated with locks acquired. This avoids a race condition where listeners_poll_count would be marked clean while it was marked dirty with sys_register_listener at the same time. It could explain some timeout issues with tests.

These changes are made under both the "Apache 2.0" and the "GNU Lesser General
Public License 2.1 or later" license terms (dual license).

SPDX-License-Identifier: Apache-2.0 OR LGPL-2.1-or-later

Ensure `listeners_poll_count` and `select_events_poll_count` are only
updated with locks acquired. This avoids a race condition where
`listeners_poll_count` would be marked clean while it was marked
dirty with `sys_register_listener` at the same time. It could explain some
timeout issues with tests.

Signed-off-by: Paul Guyot <[email protected]>
@bettio bettio merged commit 7189ab6 into atomvm:main Dec 19, 2025
91 checks passed
@pguyot pguyot deleted the w51/fix-race-condition-in-generic-unix-listeners branch December 19, 2025 18:50
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.

2 participants