mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-10 01:58:19 +00:00
thread_init_and_detach shouldn't return thread since you can't access it anymore anyway
This commit is contained in:
parent
7e82bf3a53
commit
021837fa60
|
@ -833,12 +833,12 @@ void thread_detach(void *thread)
|
|||
#endif
|
||||
}
|
||||
|
||||
void *thread_init_and_detach(void (*threadfunc)(void *), void *u, const char *name)
|
||||
bool thread_init_and_detach(void (*threadfunc)(void *), void *u, const char *name)
|
||||
{
|
||||
void *thread = thread_init(threadfunc, u, name);
|
||||
if(thread)
|
||||
thread_detach(thread);
|
||||
return thread;
|
||||
return thread != nullptr;
|
||||
}
|
||||
|
||||
#if defined(CONF_FAMILY_UNIX)
|
||||
|
|
|
@ -603,9 +603,9 @@ void thread_detach(void *thread);
|
|||
* @param user Pointer to pass to the thread.
|
||||
* @param name Name describing the use of the thread
|
||||
*
|
||||
* @return The thread if no error occurred, 0 on error.
|
||||
* @return true on success, false on failure.
|
||||
*/
|
||||
void *thread_init_and_detach(void (*threadfunc)(void *), void *user, const char *name);
|
||||
bool thread_init_and_detach(void (*threadfunc)(void *), void *user, const char *name);
|
||||
|
||||
// Enable thread safety attributes only with clang.
|
||||
// The attributes can be safely erased when compiling with other compilers.
|
||||
|
|
Loading…
Reference in a new issue