Skip to content

Commit

Permalink
Delete src/thread/n3ds/SDL_syscond.c
Browse files Browse the repository at this point in the history
This PR removes the incorrect implementation of `SDL_cond` currently included with the 3DS port.

Pseudocode of the incorrect implementation of `SDL_CondWait` this PR removes:

* Receive an `SDL_cond` backed by a `libctru` `CondVar` and an `SDL_mutex` backed by a `libctru` `RecursiveLock`.
* Want to call `libctru` function `CondVar_Wait` which expects a `CondVar` and a `LightLock` (non-recursive lock)
* Do so by calling this function with the internal (inadequately protected) `LightLock` member of the `RecursiveLock` (`&mutex->lock.lock` on line 105), without updating any internal thread or lock count fields of the `RecursiveLock`.

Happy to discuss or test some examples. My own use case works much better with the generic cond logic, and this seems like a safe fix to me given that the generic logic is well-tested and this seems not to be.

If you like the PR I'll send another one for the SDL2 branch.
  • Loading branch information
ds-sloth authored and slouken committed Feb 7, 2025
1 parent 7af17f8 commit 2ced6b0
Showing 1 changed file with 0 additions and 111 deletions.
111 changes: 0 additions & 111 deletions src/thread/n3ds/SDL_syscond.c

This file was deleted.

0 comments on commit 2ced6b0

Please sign in to comment.