Skip to content

Commit 3a23994

Browse files
committed
debug windows
1 parent 310400f commit 3a23994

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

libcxx/src/atomic.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
#include <new>
1616
#include <thread>
1717
#include <type_traits>
18+
#include <iostream>
1819

1920
#include "include/apple_availability.h"
2021

@@ -163,8 +164,10 @@ static void __platform_wait_on_address(void const* __ptr, void const* __val) {
163164
static auto wait_on_address =
164165
reinterpret_cast<BOOL(WINAPI*)(void*, PVOID, SIZE_T, DWORD)>(win32_get_synch_api_function("WaitOnAddress"));
165166
if (wait_on_address != nullptr) {
167+
std::cerr << "waiting with windows api of size " << _Size << std::endl;
166168
wait_on_address(const_cast<void*>(__ptr), &__val, _Size, INFINITE);
167169
} else {
170+
std::cerr << "waiting with backoff of size " << _Size << std::endl;
168171
__libcpp_thread_poll_with_backoff(
169172
[=]() -> bool { return std::memcmp(const_cast<const void*>(__ptr), __val, _Size) != 0; },
170173
__libcpp_timed_backoff_policy());
@@ -179,6 +182,7 @@ static void __platform_wake_by_address(void const* __ptr, bool __notify_one) {
179182
static auto wake_by_address_single =
180183
reinterpret_cast<void(WINAPI*)(PVOID)>(win32_get_synch_api_function("WakeByAddressSingle"));
181184
if (wake_by_address_single != nullptr) {
185+
std::cerr << "wake one with windows api of size " << _Size << std::endl;
182186
wake_by_address_single(const_cast<void*>(__ptr));
183187
} else {
184188
// The fallback implementation of waking does nothing, as the fallback wait implementation just does polling, so
@@ -189,6 +193,7 @@ static void __platform_wake_by_address(void const* __ptr, bool __notify_one) {
189193
static auto wake_by_address_all =
190194
reinterpret_cast<void(WINAPI*)(PVOID)>(win32_get_synch_api_function("WakeByAddressAll"));
191195
if (wake_by_address_all != nullptr) {
196+
std::cerr << "wake all with windows api of size " << _Size << std::endl;
192197
wake_by_address_all(const_cast<void*>(__ptr));
193198
} else {
194199
// The fallback implementation of waking does nothing, as the fallback wait implementation just does polling, so

0 commit comments

Comments
 (0)