summaryrefslogtreecommitdiff
path: root/src/os_posix/os_sleep.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/os_posix/os_sleep.c')
-rw-r--r--src/os_posix/os_sleep.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/os_posix/os_sleep.c b/src/os_posix/os_sleep.c
index a0545d3f5fe..67c0aaa375c 100644
--- a/src/os_posix/os_sleep.c
+++ b/src/os_posix/os_sleep.c
@@ -18,6 +18,14 @@ __wt_sleep(uint64_t seconds, uint64_t micro_seconds)
{
struct timeval t;
+ /*
+ * Sleeping isn't documented as a memory barrier, and it's a reasonable
+ * expectation to have. There's no reason not to explicitly include a
+ * barrier since we're giving up the CPU, and ensures callers are never
+ * surprised.
+ */
+ WT_FULL_BARRIER();
+
t.tv_sec = (time_t)(seconds + micro_seconds / WT_MILLION);
t.tv_usec = (suseconds_t)(micro_seconds % WT_MILLION);