util/c11: Update function u_thread_create to be c11 conformance
Do not assume thrd_t to be a pointer or integer, as the C11 standard tells us: thrd_t: implementation-defined complete object type identifying a thread At https://en.cppreference.com/w/c/thread So we always return the thread creation return code instead of thrd_t value, and judge the return code properly. Signed-off-by: Yonggang Luo <luoyonggang@gmail.com> Reviewed-by: Jesse Natalie <jenatali@microsoft.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15087>
This commit is contained in:
+1
-3
@@ -337,9 +337,7 @@ util_queue_create_thread(struct util_queue *queue, unsigned index)
|
||||
input->queue = queue;
|
||||
input->thread_index = index;
|
||||
|
||||
queue->threads[index] = u_thread_create(util_queue_thread_func, input);
|
||||
|
||||
if (!queue->threads[index]) {
|
||||
if (thrd_success != u_thread_create(queue->threads + index, util_queue_thread_func, input)) {
|
||||
free(input);
|
||||
return false;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user