summaryrefslogtreecommitdiff
path: root/tests/barrier4.c
diff options
context:
space:
mode:
Diffstat (limited to 'tests/barrier4.c')
-rw-r--r--tests/barrier4.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/tests/barrier4.c b/tests/barrier4.c
index 8f33e85..dd40b79 100644
--- a/tests/barrier4.c
+++ b/tests/barrier4.c
@@ -23,14 +23,24 @@ func(void * arg)
int result = pthread_barrier_wait(&barrier);
assert(pthread_mutex_lock(&mx) == 0);
+
+// printf("Barrier wait returned %d [%d]\n", result, WAIT_FAILED);
+// fflush(stdout);
+
if (result == PTHREAD_BARRIER_SERIAL_THREAD)
{
serialThreadCount++;
}
- else
+ else if (0 == result)
{
otherThreadCount++;
}
+ else
+ {
+ printf("Barrier wait failed: error = %s\n", error_string[result]);
+ fflush(stdout);
+ return NULL;
+ }
assert(pthread_mutex_unlock(&mx) == 0);
return NULL;