Skip to content

Commit ec0e4e2

Browse files
committed
docs: Mark most of SDL_filesystem.h as thread-safe.
Fixes #13738.
1 parent 29cff6e commit ec0e4e2

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

include/SDL3/SDL_filesystem.h

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,8 @@ extern "C" {
8989
* doesn't implement this functionality, call SDL_GetError() for more
9090
* information.
9191
*
92+
* \threadsafety It is safe to call this function from any thread.
93+
*
9294
* \since This function is available since SDL 3.2.0.
9395
*
9496
* \sa SDL_GetPrefPath
@@ -150,6 +152,8 @@ extern SDL_DECLSPEC const char * SDLCALL SDL_GetBasePath(void);
150152
* etc.). This should be freed with SDL_free() when it is no longer
151153
* needed.
152154
*
155+
* \threadsafety It is safe to call this function from any thread.
156+
*
153157
* \since This function is available since SDL 3.2.0.
154158
*
155159
* \sa SDL_GetBasePath
@@ -222,6 +226,8 @@ typedef enum SDL_Folder
222226
* \returns either a null-terminated C string containing the full path to the
223227
* folder, or NULL if an error happened.
224228
*
229+
* \threadsafety It is safe to call this function from any thread.
230+
*
225231
* \since This function is available since SDL 3.2.0.
226232
*/
227233
extern SDL_DECLSPEC const char * SDLCALL SDL_GetUserFolder(SDL_Folder folder);
@@ -289,6 +295,8 @@ typedef Uint32 SDL_GlobFlags;
289295
* \returns true on success or false on failure; call SDL_GetError() for more
290296
* information.
291297
*
298+
* \threadsafety It is safe to call this function from any thread.
299+
*
292300
* \since This function is available since SDL 3.2.0.
293301
*/
294302
extern SDL_DECLSPEC bool SDLCALL SDL_CreateDirectory(const char *path);
@@ -352,6 +360,8 @@ typedef SDL_EnumerationResult (SDLCALL *SDL_EnumerateDirectoryCallback)(void *us
352360
* \returns true on success or false on failure; call SDL_GetError() for more
353361
* information.
354362
*
363+
* \threadsafety It is safe to call this function from any thread.
364+
*
355365
* \since This function is available since SDL 3.2.0.
356366
*/
357367
extern SDL_DECLSPEC bool SDLCALL SDL_EnumerateDirectory(const char *path, SDL_EnumerateDirectoryCallback callback, void *userdata);
@@ -366,6 +376,8 @@ extern SDL_DECLSPEC bool SDLCALL SDL_EnumerateDirectory(const char *path, SDL_En
366376
* \returns true on success or false on failure; call SDL_GetError() for more
367377
* information.
368378
*
379+
* \threadsafety It is safe to call this function from any thread.
380+
*
369381
* \since This function is available since SDL 3.2.0.
370382
*/
371383
extern SDL_DECLSPEC bool SDLCALL SDL_RemovePath(const char *path);
@@ -389,6 +401,8 @@ extern SDL_DECLSPEC bool SDLCALL SDL_RemovePath(const char *path);
389401
* \returns true on success or false on failure; call SDL_GetError() for more
390402
* information.
391403
*
404+
* \threadsafety It is safe to call this function from any thread.
405+
*
392406
* \since This function is available since SDL 3.2.0.
393407
*/
394408
extern SDL_DECLSPEC bool SDLCALL SDL_RenamePath(const char *oldpath, const char *newpath);
@@ -429,6 +443,10 @@ extern SDL_DECLSPEC bool SDLCALL SDL_RenamePath(const char *oldpath, const char
429443
* \returns true on success or false on failure; call SDL_GetError() for more
430444
* information.
431445
*
446+
* \threadsafety It is safe to call this function from any thread, but this
447+
* operation is not atomic, so the app might need to protect
448+
* access to specific paths from other threads if appropriate.
449+
*
432450
* \since This function is available since SDL 3.2.0.
433451
*/
434452
extern SDL_DECLSPEC bool SDLCALL SDL_CopyFile(const char *oldpath, const char *newpath);
@@ -442,6 +460,8 @@ extern SDL_DECLSPEC bool SDLCALL SDL_CopyFile(const char *oldpath, const char *n
442460
* \returns true on success or false if the file doesn't exist, or another
443461
* failure; call SDL_GetError() for more information.
444462
*
463+
* \threadsafety It is safe to call this function from any thread.
464+
*
445465
* \since This function is available since SDL 3.2.0.
446466
*/
447467
extern SDL_DECLSPEC bool SDLCALL SDL_GetPathInfo(const char *path, SDL_PathInfo *info);
@@ -496,6 +516,8 @@ extern SDL_DECLSPEC char ** SDLCALL SDL_GlobDirectory(const char *path, const ch
496516
* platform-dependent notation. NULL if there's a problem. This
497517
* should be freed with SDL_free() when it is no longer needed.
498518
*
519+
* \threadsafety It is safe to call this function from any thread.
520+
*
499521
* \since This function is available since SDL 3.2.0.
500522
*/
501523
extern SDL_DECLSPEC char * SDLCALL SDL_GetCurrentDirectory(void);

0 commit comments

Comments
 (0)