-
Notifications
You must be signed in to change notification settings - Fork 358
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
Possible data race in src/posix/pthread.cpp #2200
Comments
Not saying you are wrong here because there IS a race inside my threads implementation, but are you sure about this? Because I'm incrementing using:
So, regardless of the counter itself, the source of new IDs is an atomic add. |
This is what I see on line 16. |
Oh yes, I thought you meant src/kernel/threads.cpp. No, we don't use that anymore - it should have been deleted. We get pthreads from musl now. https://github.com/includeos/IncludeOS/blob/master/src/musl/CMakeLists.txt The file isn't in the build list. |
Alright, thanks. I was glancing over the code and thought maybe I should open an issue about this. |
Inside pthread_create, static int thread_id = 0 increments each time a new thread is created, and it is not atomic, possibly causing a data race.
The text was updated successfully, but these errors were encountered: