summaryrefslogtreecommitdiff
path: root/src/basic
diff options
context:
space:
mode:
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2016-01-19 21:29:59 -0500
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2016-01-20 18:55:56 -0500
commit5c687f08caddf3c7d80dccb69093b91eff1ca92e (patch)
tree75d3ce6c86732390a2151b87f28d7a2c647bb5c2 /src/basic
parentbaa33e79e3a64ce06830b4fc53d943d572cfb24f (diff)
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.
Diffstat (limited to 'src/basic')
-rw-r--r--src/basic/barrier.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/basic/barrier.c b/src/basic/barrier.c
index 9a78a80eb2..26ae123341 100644
--- a/src/basic/barrier.c
+++ b/src/basic/barrier.c
@@ -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));