mirror of
https://github.com/libsdl-org/SDL.git
synced 2026-06-04 19:55:19 +00:00
Fixed some Wayland cursor related thread-safety warnings
This commit is contained in:
parent
90756b542f
commit
64def01534
1 changed files with 10 additions and 7 deletions
|
|
@ -565,18 +565,21 @@ void Wayland_CursorStateDestroyFrameCallback(SDL_WaylandCursorState *state)
|
|||
SDL_UnlockMutex(cursor_thread_context.lock);
|
||||
}
|
||||
|
||||
static void Wayland_CursorStateResetAnimationState(SDL_WaylandCursorState *state)
|
||||
{
|
||||
state->last_frame_callback_time_ms = SDL_GetTicks();
|
||||
state->current_frame_time_ms = 0;
|
||||
state->current_frame = 0;
|
||||
}
|
||||
|
||||
static void Wayland_CursorStateResetAnimation(SDL_WaylandCursorState *state, bool lock)
|
||||
{
|
||||
if (lock) {
|
||||
SDL_LockMutex(cursor_thread_context.lock);
|
||||
}
|
||||
|
||||
state->last_frame_callback_time_ms = SDL_GetTicks();
|
||||
state->current_frame_time_ms = 0;
|
||||
state->current_frame = 0;
|
||||
|
||||
if (lock) {
|
||||
Wayland_CursorStateResetAnimationState(state);
|
||||
SDL_UnlockMutex(cursor_thread_context.lock);
|
||||
} else {
|
||||
Wayland_CursorStateResetAnimationState(state);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue