File tree 2 files changed +26
-2
lines changed
2 files changed +26
-2
lines changed Original file line number Diff line number Diff line change 25
25
/**
26
26
* # CategoryMutex
27
27
*
28
- * Functions to provide thread synchronization primitives.
28
+ * SDL offers several thread synchronization primitives. This document can't
29
+ * cover the complicated topic of thread safety, but reading up on what each
30
+ * of these primitives are, why they are useful, and how to correctly use them
31
+ * is vital to writing correct and safe multithreaded programs.
32
+ *
33
+ * - Mutexes: SDL_CreateMutex()
34
+ * - Read/Write locks: SDL_CreateRWLock()
35
+ * - Semaphores: SDL_CreateSemaphore()
36
+ * - Condition variables: SDL_CreateCondition()
37
+ *
38
+ * SDL also offers a datatype, SDL_InitState, which can be used to make sure
39
+ * only one thread initializes/deinitializes some resource that several
40
+ * threads might try to use for the first time simultaneously.
29
41
*/
30
42
31
43
#include <SDL3/SDL_stdinc.h>
Original file line number Diff line number Diff line change 25
25
/**
26
26
* # CategoryThread
27
27
*
28
- * SDL thread management routines.
28
+ * SDL offers cross-platform thread management functions. These are mostly
29
+ * concerned with starting threads, setting their priority, and dealing with
30
+ * their termination.
31
+ *
32
+ * In addition, there is support for Thread Local Storage (data that is unique
33
+ * to each thread, but accessed from a single key).
34
+ *
35
+ * On platforms without thread support (such as Emscripten when built without
36
+ * pthreads), these functions still exist, but things like SDL_CreateThread()
37
+ * will report failure without doing anything.
38
+ *
39
+ * If you're going to work with threads, you almost certainly need to have a
40
+ * good understanding of [CategoryMutex](CategoryMutex) as well.
29
41
*/
30
42
31
43
#include <SDL3/SDL_stdinc.h>
You can’t perform that action at this time.
0 commit comments