Skip to content

Commit 1502e29

Browse files
authored
Restore Win7 compat by using old versions of threadpool functions (#895)
1 parent d61cb15 commit 1502e29

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

strings/base_coroutine_threadpool.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -414,7 +414,7 @@ WINRT_EXPORT namespace winrt
414414
m_handle = handle;
415415
m_timer.attach(check_pointer(WINRT_IMPL_CreateThreadpoolTimer(callback, this, nullptr)));
416416
int64_t relative_count = -m_duration.count();
417-
WINRT_IMPL_SetThreadpoolTimerEx(m_timer.get(), &relative_count, 0, 0);
417+
WINRT_IMPL_SetThreadpoolTimer(m_timer.get(), &relative_count, 0, 0);
418418

419419
state expected = state::idle;
420420
if (!m_state.compare_exchange_strong(expected, state::pending, std::memory_order_release))
@@ -435,10 +435,10 @@ WINRT_EXPORT namespace winrt
435435

436436
void fire_immediately() noexcept
437437
{
438-
if (WINRT_IMPL_SetThreadpoolTimerEx(m_timer.get(), nullptr, 0, 0))
438+
if (WINRT_IMPL_SetThreadpoolTimer(m_timer.get(), nullptr, 0, 0))
439439
{
440440
int64_t now = 0;
441-
WINRT_IMPL_SetThreadpoolTimerEx(m_timer.get(), &now, 0, 0);
441+
WINRT_IMPL_SetThreadpoolTimer(m_timer.get(), &now, 0, 0);
442442
}
443443
}
444444

@@ -513,7 +513,7 @@ WINRT_EXPORT namespace winrt
513513
m_wait.attach(check_pointer(WINRT_IMPL_CreateThreadpoolWait(callback, this, nullptr)));
514514
int64_t relative_count = -m_timeout.count();
515515
int64_t* file_time = relative_count != 0 ? &relative_count : nullptr;
516-
WINRT_IMPL_SetThreadpoolWaitEx(m_wait.get(), m_handle, file_time, nullptr);
516+
WINRT_IMPL_SetThreadpoolWait(m_wait.get(), m_handle, file_time);
517517

518518
state expected = state::idle;
519519
if (!m_state.compare_exchange_strong(expected, state::pending, std::memory_order_release))
@@ -535,10 +535,10 @@ WINRT_EXPORT namespace winrt
535535

536536
void fire_immediately() noexcept
537537
{
538-
if (WINRT_IMPL_SetThreadpoolWaitEx(m_wait.get(), nullptr, nullptr, nullptr))
538+
if (WINRT_IMPL_SetThreadpoolWait(m_wait.get(), nullptr, nullptr))
539539
{
540540
int64_t now = 0;
541-
WINRT_IMPL_SetThreadpoolWaitEx(m_wait.get(), WINRT_IMPL_GetCurrentProcess(), &now, nullptr);
541+
WINRT_IMPL_SetThreadpoolWait(m_wait.get(), WINRT_IMPL_GetCurrentProcess(), &now);
542542
}
543543
}
544544

strings/base_extern.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -65,10 +65,10 @@ extern "C"
6565

6666
int32_t __stdcall WINRT_IMPL_TrySubmitThreadpoolCallback(void(__stdcall *callback)(void*, void* context), void* context, void*) noexcept;
6767
winrt::impl::ptp_timer __stdcall WINRT_IMPL_CreateThreadpoolTimer(void(__stdcall *callback)(void*, void* context, void*), void* context, void*) noexcept;
68-
int32_t __stdcall WINRT_IMPL_SetThreadpoolTimerEx(winrt::impl::ptp_timer timer, void* time, uint32_t period, uint32_t window) noexcept;
68+
int32_t __stdcall WINRT_IMPL_SetThreadpoolTimer(winrt::impl::ptp_timer timer, void* time, uint32_t period, uint32_t window) noexcept;
6969
void __stdcall WINRT_IMPL_CloseThreadpoolTimer(winrt::impl::ptp_timer timer) noexcept;
7070
winrt::impl::ptp_wait __stdcall WINRT_IMPL_CreateThreadpoolWait(void(__stdcall *callback)(void*, void* context, void*, uint32_t result), void* context, void*) noexcept;
71-
int32_t __stdcall WINRT_IMPL_SetThreadpoolWaitEx(winrt::impl::ptp_wait wait, void* handle, void* timeout, void* reserved) noexcept;
71+
int32_t __stdcall WINRT_IMPL_SetThreadpoolWait(winrt::impl::ptp_wait wait, void* handle, void* timeout) noexcept;
7272
void __stdcall WINRT_IMPL_CloseThreadpoolWait(winrt::impl::ptp_wait wait) noexcept;
7373
winrt::impl::ptp_io __stdcall WINRT_IMPL_CreateThreadpoolIo(void* object, void(__stdcall *callback)(void*, void* context, void* overlapped, uint32_t result, std::size_t bytes, void*) noexcept, void* context, void*) noexcept;
7474
void __stdcall WINRT_IMPL_StartThreadpoolIo(winrt::impl::ptp_io io) noexcept;
@@ -149,10 +149,10 @@ WINRT_IMPL_LINK(WaitForSingleObject, 8)
149149

150150
WINRT_IMPL_LINK(TrySubmitThreadpoolCallback, 12)
151151
WINRT_IMPL_LINK(CreateThreadpoolTimer, 12)
152-
WINRT_IMPL_LINK(SetThreadpoolTimerEx, 16)
152+
WINRT_IMPL_LINK(SetThreadpoolTimer, 16)
153153
WINRT_IMPL_LINK(CloseThreadpoolTimer, 4)
154154
WINRT_IMPL_LINK(CreateThreadpoolWait, 12)
155-
WINRT_IMPL_LINK(SetThreadpoolWaitEx, 16)
155+
WINRT_IMPL_LINK(SetThreadpoolWait, 12)
156156
WINRT_IMPL_LINK(CloseThreadpoolWait, 4)
157157
WINRT_IMPL_LINK(CreateThreadpoolIo, 16)
158158
WINRT_IMPL_LINK(StartThreadpoolIo, 4)

0 commit comments

Comments
 (0)