@@ -59,13 +59,13 @@ bool swift::threading_impl::thread_is_main() {
59
59
60
60
void swift::threading_impl::once_slow (once_t &predicate, void (*fn)(void *),
61
61
void *context) {
62
- std:: int64_t expected = 0 ;
63
- if (predicate.compare_exchange_strong (expected, (std:: int64_t ) 1 ,
62
+ intptr_t expected = 0 ;
63
+ if (predicate.compare_exchange_strong (expected, static_cast < intptr_t >( 1 ) ,
64
64
std::memory_order_relaxed,
65
65
std::memory_order_relaxed)) {
66
66
fn (context);
67
67
68
- predicate.store ((std:: int64_t )- 1 , std::memory_order_release);
68
+ predicate.store (static_cast < intptr_t >(- 1 ) , std::memory_order_release);
69
69
70
70
#if _WIN32_WINNT >= 0x0602
71
71
// On Windows 8, use WakeByAddressAll() to wake waiters
@@ -84,7 +84,7 @@ void swift::threading_impl::once_slow(once_t &predicate, void (*fn)(void *),
84
84
#if _WIN32_WINNT >= 0x0602
85
85
// On Windows 8, loop waiting on the address until it changes to -1
86
86
while (expected >= 0 ) {
87
- WaitOnAddress (&predicate, &expected, 8 , INFINITE);
87
+ WaitOnAddress (&predicate, &expected, sizeof (expected) , INFINITE);
88
88
expected = predicate.load (std::memory_order_acquire);
89
89
}
90
90
#else
0 commit comments