Commit 75c729e4 authored by Vinson Lee's avatar Vinson Lee

glx-multithread-clearbuffer: Check pthread_join return value.

Fix Coverity unchecked return value defect.

CID: 1415101
Signed-off-by: Vinson Lee's avatarVinson Lee <vlee@freedesktop.org>
Reviewed-by: Brian Paul's avatarBrian Paul <brianp@vmware.com>
Reviewed-by: default avatarMarek Olšák <marek.olsak@amd.com>
parent a76e2db3
......@@ -82,6 +82,7 @@ main(int argc, char **argv)
{
/* Need at least 16 contexts to congest the thread queue. */
pthread_t thread[16];
bool pass = true;
XInitThreads();
......@@ -90,11 +91,13 @@ main(int argc, char **argv)
for (int i = 0; i < ARRAY_SIZE(thread); i++)
pthread_create(&thread[i], NULL, thread_func, NULL);
for (int i = 0; i < ARRAY_SIZE(thread); i++)
pthread_join(thread[i], NULL);
for (int i = 0; i < ARRAY_SIZE(thread); i++) {
if (pthread_join(thread[i], NULL) != 0)
pass = false;
}
pthread_mutex_destroy(&mutex);
piglit_report_result(PIGLIT_PASS);
piglit_report_result(pass ? PIGLIT_PASS : PIGLIT_FAIL);
return 0;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment