Skip to content

Conversation

mporsch
Copy link

@mporsch mporsch commented Jun 19, 2025

Looking at the multi-thread locking I saw many raw lock & unlock calls. This PR uses lock guard objects where applicable and introduces an optional<guard> as a lazy man's unique_lock. Looking at the removed unlock conditions you will find the same condition that was used to conditionally lock in the first place.

I unnamed some temporary guard objects just to avoid name clashes.

Some raw and even unmatched lock & unlock calls remain for some less trivial use cases.

I built and tested successfully with Cyberpunk 2077 on AMD with DLSS frame generation only. Please review carefully as I have little experience with the project and hardly tested all use cases.

@mporsch mporsch marked this pull request as ready for review June 19, 2025 22:52
@mporsch
Copy link
Author

mporsch commented Aug 12, 2025

Looking at ee65f35; would you reconsider the stateful locking approach? If the naked std::optional offends you, consider hiding it behind something like OwnedUniqueLock with a facade ála std::unique_lock.

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.

1 participant