projects
/
model-checker-benchmarks.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
make warnings go away
[model-checker-benchmarks.git]
/
mpmc-queue
/
mpmc-queue.cc
diff --git
a/mpmc-queue/mpmc-queue.cc
b/mpmc-queue/mpmc-queue.cc
index b62d8d31f496bce7a686332aad23ef7140e56653..7de14d589c5819b9055618928eae43accc2f15bd 100644
(file)
--- a/
mpmc-queue/mpmc-queue.cc
+++ b/
mpmc-queue/mpmc-queue.cc
@@
-18,7
+18,7
@@
void threadA(struct mpmc_boundq_1_alt<int32_t, sizeof(int32_t)> *queue)
void threadB(struct mpmc_boundq_1_alt<int32_t, sizeof(int32_t)> *queue)
{
int32_t *bin;
void threadB(struct mpmc_boundq_1_alt<int32_t, sizeof(int32_t)> *queue)
{
int32_t *bin;
- while (
bin = queue->read_fetch()
) {
+ while (
(bin = queue->read_fetch()) != NULL
) {
printf("Read: %d\n", load_32(bin));
queue->read_consume();
}
printf("Read: %d\n", load_32(bin));
queue->read_consume();
}
@@
-30,7
+30,7
@@
void threadC(struct mpmc_boundq_1_alt<int32_t, sizeof(int32_t)> *queue)
store_32(bin, 1);
queue->write_publish();
store_32(bin, 1);
queue->write_publish();
- while (
bin = queue->read_fetch()
) {
+ while (
(bin = queue->read_fetch()) != NULL
) {
printf("Read: %d\n", load_32(bin));
queue->read_consume();
}
printf("Read: %d\n", load_32(bin));
queue->read_consume();
}