@@ -59,13 +59,13 @@ bool swift::threading_impl::thread_is_main() {
5959
6060void swift::threading_impl::once_slow (once_t &predicate, void (*fn)(void *),
6161 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 ) ,
6464 std::memory_order_relaxed,
6565 std::memory_order_relaxed)) {
6666 fn (context);
6767
68- predicate.store ((std:: int64_t )- 1 , std::memory_order_release);
68+ predicate.store (static_cast < intptr_t >(- 1 ) , std::memory_order_release);
6969
7070#if _WIN32_WINNT >= 0x0602
7171 // On Windows 8, use WakeByAddressAll() to wake waiters
@@ -84,7 +84,7 @@ void swift::threading_impl::once_slow(once_t &predicate, void (*fn)(void *),
8484#if _WIN32_WINNT >= 0x0602
8585 // On Windows 8, loop waiting on the address until it changes to -1
8686 while (expected >= 0 ) {
87- WaitOnAddress (&predicate, &expected, 8 , INFINITE);
87+ WaitOnAddress (&predicate, &expected, sizeof (expected) , INFINITE);
8888 expected = predicate.load (std::memory_order_acquire);
8989 }
9090#else
0 commit comments