aboutsummaryrefslogtreecommitdiff
path: root/include/block/block.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/block/block.h')
-rw-r--r--include/block/block.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/include/block/block.h b/include/block/block.h
index 9b355e9..a4f09df 100644
--- a/include/block/block.h
+++ b/include/block/block.h
@@ -402,7 +402,8 @@ void bdrv_drain_all(void);
* block_job_defer_to_main_loop for how to do it). \
*/ \
assert(!bs_->wakeup); \
- bs_->wakeup = true; \
+ /* Set bs->wakeup before evaluating cond. */ \
+ atomic_mb_set(&bs_->wakeup, true); \
while (busy_) { \
if ((cond)) { \
waited_ = busy_ = true; \
@@ -414,7 +415,7 @@ void bdrv_drain_all(void);
waited_ |= busy_; \
} \
} \
- bs_->wakeup = false; \
+ atomic_set(&bs_->wakeup, false); \
} \
waited_; })