summaryrefslogtreecommitdiff
path: root/abseil-cpp/absl/base/internal/spinlock_win32.inc
diff options
context:
space:
mode:
Diffstat (limited to 'abseil-cpp/absl/base/internal/spinlock_win32.inc')
-rw-r--r--abseil-cpp/absl/base/internal/spinlock_win32.inc15
1 files changed, 9 insertions, 6 deletions
diff --git a/abseil-cpp/absl/base/internal/spinlock_win32.inc b/abseil-cpp/absl/base/internal/spinlock_win32.inc
index 78654b5..934c201 100644
--- a/abseil-cpp/absl/base/internal/spinlock_win32.inc
+++ b/abseil-cpp/absl/base/internal/spinlock_win32.inc
@@ -20,18 +20,21 @@
extern "C" {
-void AbslInternalSpinLockDelay(std::atomic<uint32_t>* /* lock_word */,
- uint32_t /* value */, int loop,
- absl::base_internal::SchedulingMode /* mode */) {
+void ABSL_INTERNAL_C_SYMBOL(AbslInternalSpinLockDelay)(
+ std::atomic<uint32_t>* /* lock_word */, uint32_t /* value */, int loop,
+ absl::base_internal::SchedulingMode /* mode */) {
if (loop == 0) {
} else if (loop == 1) {
Sleep(0);
} else {
- Sleep(absl::base_internal::SpinLockSuggestedDelayNS(loop) / 1000000);
+ // SpinLockSuggestedDelayNS() always returns a positive integer, so this
+ // static_cast is safe.
+ Sleep(static_cast<DWORD>(
+ absl::base_internal::SpinLockSuggestedDelayNS(loop) / 1000000));
}
}
-void AbslInternalSpinLockWake(std::atomic<uint32_t>* /* lock_word */,
- bool /* all */) {}
+void ABSL_INTERNAL_C_SYMBOL(AbslInternalSpinLockWake)(
+ std::atomic<uint32_t>* /* lock_word */, bool /* all */) {}
} // extern "C"