mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-10 01:58:19 +00:00
adding thread_detach to system.h and system.c
This commit is contained in:
parent
b60dc13fbb
commit
0ea5641df4
|
@ -408,6 +408,17 @@ void thread_sleep(int milliseconds)
|
|||
#endif
|
||||
}
|
||||
|
||||
void thread_detach(void *thread)
|
||||
{
|
||||
#if defined(CONF_FAMILY_UNIX)
|
||||
pthread_detach((pthread_t)(thread));
|
||||
#elif defined(CONF_FAMILY_WINDOWS)
|
||||
CloseHandle(thread);
|
||||
#else
|
||||
#error not implemented
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -367,6 +367,16 @@ void thread_destroy(void *thread);
|
|||
*/
|
||||
void thread_yield();
|
||||
|
||||
/*
|
||||
Function: thread_detach
|
||||
Puts the thread in the detached thread, guaranteeing that
|
||||
resources of the thread will be freed immediately when the
|
||||
thread terminates.
|
||||
|
||||
Parameters:
|
||||
thread - Thread to detach
|
||||
*/
|
||||
void thread_detach(void *thread);
|
||||
|
||||
/* Group: Locks */
|
||||
typedef void* LOCK;
|
||||
|
|
Loading…
Reference in a new issue