summaryrefslogtreecommitdiff
path: root/src/os_win/os_sleep.c
diff options
context:
space:
mode:
authorAlex Gorrod <alexander.gorrod@mongodb.com>2017-06-27 12:01:10 +1000
committerAlex Gorrod <alexander.gorrod@mongodb.com>2017-06-27 12:01:10 +1000
commit95d911ab246e444192f34dc395652dba2653dd3c (patch)
tree8e7c4692125a841a486607ccfe26e8499bc4c398 /src/os_win/os_sleep.c
parent19cd4d9be2c0fd980c00bb04bc949970002f5cb2 (diff)
parentd139a5d5be1d7ba94130502b379a61a809e66272 (diff)
downloadmongo-2.9.3.tar.gz
Merge branch 'mongodb-3.6'2.9.3
Diffstat (limited to 'src/os_win/os_sleep.c')
-rw-r--r--src/os_win/os_sleep.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/src/os_win/os_sleep.c b/src/os_win/os_sleep.c
index 1cb61f7c4aa..477474e0665 100644
--- a/src/os_win/os_sleep.c
+++ b/src/os_win/os_sleep.c
@@ -1,5 +1,5 @@
/*-
- * Copyright (c) 2014-2016 MongoDB, Inc.
+ * Copyright (c) 2014-2017 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
@@ -18,8 +18,15 @@ __wt_sleep(uint64_t seconds, uint64_t micro_seconds)
DWORD dwMilliseconds;
/*
- * If the caller wants a small pause, set to our
- * smallest granularity.
+ * 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();
+
+ /*
+ * If the caller wants a small pause, set to our smallest granularity.
*/
if (seconds == 0 && micro_seconds < WT_THOUSAND)
micro_seconds = WT_THOUSAND;