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:
Yonggang Luo
2022-06-14 14:00:57 +08:00
committed by Marge Bot
parent 6e33ef2bb9
commit a9e2c699aa
12 changed files with 40 additions and 34 deletions
+1 -3
View File
@@ -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;
}