Add assert in barrier code

This function is not supposed to fail, it only returns a boolean.
So add an assert in case anyone calls it without proper initialization
of *b.
This commit is contained in:
Zbigniew Jędrzejewski-Szmek
2016-01-20 18:55:56 -05:00
parent baa33e79e3
commit 5c687f08ca
+1
View File
@@ -197,6 +197,7 @@ static bool barrier_write(Barrier *b, uint64_t buf) {
if (barrier_i_aborted(b))
return false;
assert(b->me >= 0);
do {
len = write(b->me, &buf, sizeof(buf));
} while (len < 0 && IN_SET(errno, EAGAIN, EINTR));