mirror of
https://github.com/libsdl-org/SDL.git
synced 2025-05-15 17:28:28 +00:00
Sync wiki -> header.
This commit is contained in:
parent
f8c1fc49d9
commit
c88eb7a896
31 changed files with 635 additions and 654 deletions
|
@ -214,30 +214,29 @@ SDL_CreateThread(SDL_ThreadFunction fn, const char *name, void *data);
|
|||
/**
|
||||
* Create a new thread with a specific stack size.
|
||||
*
|
||||
* SDL makes an attempt to report `name` to the system, so that debuggers
|
||||
* can display it. Not all platforms support this.
|
||||
* SDL makes an attempt to report `name` to the system, so that debuggers can
|
||||
* display it. Not all platforms support this.
|
||||
*
|
||||
* Thread naming is a little complicated: Most systems have very small
|
||||
* limits for the string length (Haiku has 32 bytes, Linux currently has 16,
|
||||
* Visual C++ 6.0 has _nine_!), and possibly other arbitrary rules. You'll
|
||||
* have to see what happens with your system's debugger. The name should be
|
||||
* UTF-8 (but using the naming limits of C identifiers is a better bet).
|
||||
* There are no requirements for thread naming conventions, so long as the
|
||||
* string is null-terminated UTF-8, but these guidelines are helpful in
|
||||
* choosing a name:
|
||||
* Thread naming is a little complicated: Most systems have very small limits
|
||||
* for the string length (Haiku has 32 bytes, Linux currently has 16, Visual
|
||||
* C++ 6.0 has _nine_!), and possibly other arbitrary rules. You'll have to
|
||||
* see what happens with your system's debugger. The name should be UTF-8 (but
|
||||
* using the naming limits of C identifiers is a better bet). There are no
|
||||
* requirements for thread naming conventions, so long as the string is
|
||||
* null-terminated UTF-8, but these guidelines are helpful in choosing a name:
|
||||
*
|
||||
* https://stackoverflow.com/questions/149932/naming-conventions-for-threads
|
||||
*
|
||||
* If a system imposes requirements, SDL will try to munge the string for
|
||||
* it (truncate, etc), but the original string contents will be available
|
||||
* from SDL_GetThreadName().
|
||||
* If a system imposes requirements, SDL will try to munge the string for it
|
||||
* (truncate, etc), but the original string contents will be available from
|
||||
* SDL_GetThreadName().
|
||||
*
|
||||
* The size (in bytes) of the new stack can be specified. Zero means "use
|
||||
* the system default" which might be wildly different between platforms.
|
||||
* x86 Linux generally defaults to eight megabytes, an embedded device
|
||||
* might be a few kilobytes instead. You generally need to specify a stack
|
||||
* that is a multiple of the system's page size (in many cases, this is 4
|
||||
* kilobytes, but check your system documentation).
|
||||
* The size (in bytes) of the new stack can be specified. Zero means "use the
|
||||
* system default" which might be wildly different between platforms. x86
|
||||
* Linux generally defaults to eight megabytes, an embedded device might be a
|
||||
* few kilobytes instead. You generally need to specify a stack that is a
|
||||
* multiple of the system's page size (in many cases, this is 4 kilobytes, but
|
||||
* check your system documentation).
|
||||
*
|
||||
* In SDL 2.1, stack size will be folded into the original SDL_CreateThread
|
||||
* function, but for backwards compatibility, this is currently a separate
|
||||
|
@ -307,8 +306,8 @@ extern DECLSPEC SDL_threadID SDLCALL SDL_GetThreadID(SDL_Thread * thread);
|
|||
* Set the priority for the current thread.
|
||||
*
|
||||
* Note that some platforms will not let you alter the priority (or at least,
|
||||
* promote the thread to a higher priority) at all, and some require you
|
||||
* to be an administrator account. Be prepared for this to fail.
|
||||
* promote the thread to a higher priority) at all, and some require you to be
|
||||
* an administrator account. Be prepared for this to fail.
|
||||
*
|
||||
* \param priority the SDL_ThreadPriority to set
|
||||
* \returns 0 on success or a negative error code on failure; call
|
||||
|
@ -388,8 +387,8 @@ extern DECLSPEC void SDLCALL SDL_DetachThread(SDL_Thread * thread);
|
|||
/**
|
||||
* Create a piece of thread-local storage.
|
||||
*
|
||||
* This creates an identifier that is globally visible to all
|
||||
* threads but refers to data that is thread-specific.
|
||||
* This creates an identifier that is globally visible to all threads but
|
||||
* refers to data that is thread-specific.
|
||||
*
|
||||
* \returns the newly created thread local storage identifier or 0 on error.
|
||||
*
|
||||
|
@ -440,7 +439,7 @@ extern DECLSPEC void * SDLCALL SDL_TLSGet(SDL_TLSID id);
|
|||
extern DECLSPEC int SDLCALL SDL_TLSSet(SDL_TLSID id, const void *value, void (SDLCALL *destructor)(void*));
|
||||
|
||||
/**
|
||||
* \brief Cleanup all TLS data for this thread.
|
||||
* Cleanup all TLS data for this thread.
|
||||
*/
|
||||
extern DECLSPEC void SDLCALL SDL_TLSCleanup(void);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue