runAsThread should not automatically cleanup the passed thread_t, this should be done by the caller;

pull/86/head
Bryan Biedenkapp 11 months ago
parent d11da32be7
commit 33d6c919d7

@ -128,7 +128,6 @@ bool Thread::runAsThread(void* obj, void *(*startRoutine)(void *), thread_t* thr
#else #else
if (::pthread_create(&thread->thread, NULL, startRoutine, thread) != 0) { if (::pthread_create(&thread->thread, NULL, startRoutine, thread) != 0) {
LogError(LOG_NET, "Error returned from pthread_create, err: %d", errno); LogError(LOG_NET, "Error returned from pthread_create, err: %d", errno);
delete thread;
return false; return false;
} }
#endif // defined(_WIN32) #endif // defined(_WIN32)

@ -100,6 +100,8 @@ public:
/** /**
* @brief Executes the specified start routine to run as a thread. * @brief Executes the specified start routine to run as a thread.
* On POSIX, if the thread fails to spawn for any reason, the caller should clean up the passed thread_t
* argument.
* @param obj Instance of a object to pass to the threaded function. * @param obj Instance of a object to pass to the threaded function.
* @param startRoutine Represents the function that executes on a thread. * @param startRoutine Represents the function that executes on a thread.
* @param[out] thread Instance of the thread data. * @param[out] thread Instance of the thread data.

Loading…
Cancel
Save

Powered by TurnKey Linux.