SDL2/src
Sam Lantinga 5c29b58e95 Added support for clang thread-safety analysis
The annotations have been added to SDL_mutex.h and have been made public so applications can enable this for their own code.

Clang assumes that locking and unlocking can't fail, but SDL has the concept of a NULL mutex, so the mutex functions have been changed not to report errors if a mutex hasn't been initialized. We do have mutexes that might be accessed when they are NULL, notably in the event system, so this is an important change.

This commit cleans up a bunch of rare race conditions in the joystick and game controller code so now everything should be completely protected by the joystick lock.

To test this, change the compiler to "clang -Wthread-safety -Werror=thread-safety -DSDL_THREAD_SAFETY_ANALYSIS"
2022-12-14 09:53:39 -08:00
..
atomic Update for SDL3 coding style (#6717) 2022-11-30 12:51:59 -08:00
audio Added support for clang thread-safety analysis 2022-12-14 09:53:39 -08:00
core DBus: add a reference to the connection 2022-12-14 11:41:35 -05:00
cpuinfo Fix warnings 'macro argument should be enclosed in parentheses' 2022-12-05 09:06:44 -08:00
dynapi Added support for clang thread-safety analysis 2022-12-14 09:53:39 -08:00
events Added support for clang thread-safety analysis 2022-12-14 09:53:39 -08:00
file Clang-Tidy fixes (#6725) 2022-12-01 13:07:03 -08:00
filesystem SDL_sysfilesystem.c (SDL_GetBasePath): fixed the solaris code path. 2022-12-02 06:23:30 +03:00
haptic Added support for clang thread-safety analysis 2022-12-14 09:53:39 -08:00
hidapi Convert ticks to 64-bit, added nanosecond precision to the API 2022-12-02 12:37:41 -08:00
joystick Added support for clang thread-safety analysis 2022-12-14 09:53:39 -08:00
libm Added precompiled header support for Visual Studio and Xcode (#6710) 2022-11-29 18:34:15 -08:00
loadso Update for SDL3 coding style (#6717) 2022-11-30 12:51:59 -08:00
locale Clang-Tidy fixes (#6725) 2022-12-01 13:07:03 -08:00
main Pass the OS event timestamp for keyboard, mouse, and touch events where possible 2022-12-02 12:37:41 -08:00
misc Clang-Tidy fixes (#6725) 2022-12-01 13:07:03 -08:00
power Convert ticks to 64-bit, added nanosecond precision to the API 2022-12-02 12:37:41 -08:00
render render: Remove SDL_GetRenderDriverInfo and change SDL_CreateRenderer. 2022-12-13 23:27:35 -05:00
sensor Added support for clang thread-safety analysis 2022-12-14 09:53:39 -08:00
stdlib Clang-Tidy fixes (#6725) 2022-12-01 13:07:03 -08:00
test render: Remove SDL_GetRenderDriverInfo and change SDL_CreateRenderer. 2022-12-13 23:27:35 -05:00
thread Added support for clang thread-safety analysis 2022-12-14 09:53:39 -08:00
timer Don't assume evdev events and SDL_GetTicks() use the same time source 2022-12-05 10:40:16 -08:00
video Fix build (#6808) 2022-12-14 09:47:15 +01:00
SDL.c Update for SDL3 coding style (#6717) 2022-11-30 12:51:59 -08:00
SDL_assert.c Added support for clang thread-safety analysis 2022-12-14 09:53:39 -08:00
SDL_assert_c.h Added precompiled header support for Visual Studio and Xcode (#6710) 2022-11-29 18:34:15 -08:00
SDL_dataqueue.c Update for SDL3 coding style (#6717) 2022-11-30 12:51:59 -08:00
SDL_dataqueue.h Update for SDL3 coding style (#6717) 2022-11-30 12:51:59 -08:00
SDL_error.c Clang-Tidy fixes (#6725) 2022-12-01 13:07:03 -08:00
SDL_error_c.h Added precompiled header support for Visual Studio and Xcode (#6710) 2022-11-29 18:34:15 -08:00
SDL_guid.c Update for SDL3 coding style (#6717) 2022-11-30 12:51:59 -08:00
SDL_hints.c Update for SDL3 coding style (#6717) 2022-11-30 12:51:59 -08:00
SDL_hints_c.h Added precompiled header support for Visual Studio and Xcode (#6710) 2022-11-29 18:34:15 -08:00
SDL_internal.h Removed the nanosecond versions of event and thread primitive waits from the public API 2022-12-02 12:37:41 -08:00
SDL_intrin.h Move intrinsic includes into a private header 2022-12-04 09:34:10 -08:00
SDL_list.c Update for SDL3 coding style (#6717) 2022-11-30 12:51:59 -08:00
SDL_list.h Update for SDL3 coding style (#6717) 2022-11-30 12:51:59 -08:00
SDL_log.c Added support for clang thread-safety analysis 2022-12-14 09:53:39 -08:00
SDL_log_c.h Added precompiled header support for Visual Studio and Xcode (#6710) 2022-11-29 18:34:15 -08:00
SDL_utils.c
SDL_utils_c.h Added precompiled header support for Visual Studio and Xcode (#6710) 2022-11-29 18:34:15 -08:00