-inline smp_mb_send(i, j)
-{
- smp_mb(i, j);
- i = 0;
- do
- :: i < NR_READERS ->
- reader_barrier[i] = 1;
- do
- :: (reader_barrier[i] == 1) -> skip;
- :: (reader_barrier[i] == 0) -> break;
- od;
- i++;
- :: i >= NR_READERS ->
- break
- od;
- smp_mb(i, j);
+#ifdef WRITER_PROGRESS
+#define PROGRESS_LABEL(progressid) progress_writer_progid_##progressid:
+#else
+#define PROGRESS_LABEL(progressid)
+#endif
+
+#define smp_mb_send(i, j, progressid) \
+{ \
+ smp_mb(i, j); \
+ i = 0; \
+ do \
+ :: i < NR_READERS -> \
+ reader_barrier[i] = 1; \
+ do \
+ :: (reader_barrier[i] == 1) -> \
+ /* \
+ * Busy-looping waiting for reader barrier handling is of little\
+ * interest, given the reader has the ability to totally ignore \
+ * barrier requests. \
+ */ \
+PROGRESS_LABEL(progressid) \
+ skip; \
+ :: (reader_barrier[i] == 0) -> break; \
+ od; \
+ i++; \
+ :: i >= NR_READERS -> \
+ break \
+ od; \
+ smp_mb(i, j); \