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

DSP: Change external_interrupt_waiting from volatile to atomic #9708

Merged
merged 1 commit into from May 14, 2021

Conversation

JosJuice
Copy link
Member

Making this volatile accomplishes... Well, nothing in practice. Making it atomic, on the other hand, lets us enforce a memory ordering.

@lioncash
Copy link
Member

Will this work for the DSP JIT? Its offset is used in M_SDSP_external_interrupt_waiting to perform a CMP here, and isn't guaranteed to be 8 bits in size any longer

@JosJuice
Copy link
Member Author

JosJuice commented May 14, 2021

Wait, it's used there? Why didn't Visual Studio's "Find Usages" tell me about that :/

I'll put a static assert on it to ensure that std::atomic<bool> is 8-bit and lock-free.

Making this volatile accomplishes... Well, nothing in practice.
Making it atomic, on the other hand, lets us enforce a memory ordering.
@lioncash lioncash merged commit 41befc2 into dolphin-emu:master May 14, 2021
10 of 11 checks passed
@JosJuice JosJuice deleted the dsp-volatile branch May 14, 2021 18:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
3 participants