Skip to content

Use explicit atomics#2849

Merged
raysan5 merged 3 commits intoraysan5:masterfrom
planetis-m:patch-10
Jan 2, 2023
Merged

Use explicit atomics#2849
raysan5 merged 3 commits intoraysan5:masterfrom
planetis-m:patch-10

Conversation

@planetis-m
Copy link
Contributor

makes dataProgress atomic as well.

atomic_store(&dataLoaded, false);
dataProgress = 0;
atomic_store_explicit(&dataLoaded, false, memory_order_relaxed);
atomic_store_explicit(&dataProgress, 0, memory_order_relaxed);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are no more threads running at this point.

@planetis-m
Copy link
Contributor Author

ready.

@raysan5 raysan5 merged commit 1dbcce8 into raysan5:master Jan 2, 2023
@raysan5
Copy link
Owner

raysan5 commented Jan 2, 2023

@planetis-m thanks for the review!

@orcmid
Copy link
Contributor

orcmid commented Jan 2, 2023

Side Comment. The atomics arrived with C11, so that must be accounted for in compilation dependencies. (rayLib already has such dependencies with regard to structure initializations.) Apparently there must also be #include <stdatomic.h> according to ISO C11 and C17.

I just confirmed that stdatomic.h is available to VS 2022 Build Tools. I have not checked older Visual Studio versions.

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