Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: blocking O_NONBLOCK process bug in sleep.c #266

Merged
merged 1 commit into from
Aug 12, 2024

Conversation

Ayxan13
Copy link
Contributor

@Ayxan13 Ayxan13 commented Aug 11, 2024

There is a subtle bug that if the atomic flag changes between the time it was checked and the second time it was checked, sleep.c would potentially block a process that had specified O_NONBLOCK. This fixes the bug by using atomic_cmpxchg instead of atomic_read.

There is a subtle bug that if the atomic flag changes
between the time it was checked and the second time
it was checked, sleep.c would potentially block a
process that had specified O_NONBLOCK. This fixes
the bug by using atomic_cmpxchg instead of atomic_read.
@jserv jserv requested a review from linD026 August 12, 2024 00:56
@jserv jserv merged commit 47663d6 into sysprog21:master Aug 12, 2024
1 check passed
@jserv
Copy link
Contributor

jserv commented Aug 12, 2024

Thank @Ayxan13 for contributing!

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.

3 participants