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

Define pthread mutex as recursive #378

Merged

Conversation

CasualPokePlayer
Copy link
Contributor

For consistent semantics against other rc_mutex_t implementations (mostly more making sense with my other PRs; regardless, the current Windows mutex implementation already has recursive semantics).

Copy link
Member

@Jamiras Jamiras left a comment

Choose a reason for hiding this comment

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

I don't think the code is currently reliant on recursive locks. There's a few places with explicit comments indicating a lock is assumed to be held prior to calling the function (i.e.

/* ASSERT: this should only be called if the mutex is held */
) to eliminate the need for recursive locks.

Having said that, the changes seem reasonable, and do provide a better level of compatibility in case recursive locks end up getting introduced.

@CasualPokePlayer
Copy link
Contributor Author

CasualPokePlayer commented Oct 16, 2024

Note probably want to introduce an !defined(_3DS) for the _XOPEN_SOURCE define guard when #377 is merged.

@Jamiras Jamiras merged commit 51fee2d into RetroAchievements:develop Oct 26, 2024
7 checks passed
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