| Summary: | [PATCH] Support using CRITICAL_SECTION-based mutexes with condition variables on Windows | ||
|---|---|---|---|
| Product: | SDL | Reporter: | Cameron Gutman <cameron.gutman> |
| Component: | thread | Assignee: | Joel Linn <jl> |
| Status: | ASSIGNED --- | QA Contact: | Sam Lantinga <slouken> |
| Severity: | normal | ||
| Priority: | P2 | CC: | sezeroz |
| Version: | HG 2.0 | ||
| Hardware: | x86 | ||
| OS: | Windows 10 | ||
| Attachments: |
Patch
Patch v2 |
||
|
Description
Cameron Gutman
2021-02-09 01:09:19 UTC
Created attachment 4783 [details]
Patch
This will hit -Werror=declaration-after-statement With this we have three implementations for condvars... I deliberately ignored the Vista case because of that. Adding another hint would further increase the possible combinations. Thoughts about this from a maintainer? Will review the diff itself later Created attachment 4788 [details]
Patch v2
@Ozkan: Thanks for catching that. Fixed it in v2.
@Joel: We still only have 2 implementations of CVs. The only function that needed to change was SDL_CondWaitTimeout() and it was just the addition of a few lines (since the CS implementation is actually a bit simpler than the SRW implementation due to the lack of any internal SDL lock state). We're just calling SleepConditionVariableCS() instead of SleepConditionVariableSRW() if we're using CS-based mutexes.
The majority of the diff is that SDL_syscond_srw -> SDL_syscond_cv name change.
|